package tezt
Install
dune-project
Dependency
Authors
Maintainers
Sources
md5=81f699e653ce9fd71e11d3704638c98d
sha512=30fd97f8b2c5e1282d89c1c5dee3530d4e10e8c3a95abd281e8ecb8b2ee3c367eacb8e663ef445af2fdb0aa2d697d39d6284950b1bda35761c6a3b59e3f264b6
doc/tezt.core/Tezt_core/Diff/index.html
Module Tezt_core.DiffSource
Compute the difference between two sequences of items.
Whether an item was kept, added or removed.
Keptcarries(index_before, index_after).Addedcarriesindex_after.Removedcarriesindex_before.
type 'a t = {before : string;after : string;merged : (item_report * 'a) array;different : bool;
}Difference reports.
before and after are the names of what was compared (e.g. filenames). They are used by log.
merged is such that filtering out Added items gives the items of before and filtering out Removed items gives the items of after.
different is true iff at least one item's report is not Kept.
val arrays :
?max_sync_distance:int ->
?equal:('a -> 'a -> bool) ->
?before:string ->
?after:string ->
'a array ->
'a array ->
'a tCompute the difference between two arrays.
Usage: arrays a b
The algorithm compares items of a and b together with equal. When two items are different, the algorithm tries to find equal items later in a and b. max_sync_distance is the maximum distance after which it gives up. Increasing max_sync_distance gives more accurate results but increases the time taken quadratically.
before and after are stored in the result's before and after fields. Default values are "before" and "after" respectively.
val files :
?max_sync_distance:int ->
?before:string ->
?after:string ->
string ->
string ->
string tCompute the difference between two files.
Usage: files before_filename after_filename
Files are compared line by line.
before and after are stored in the result's before and after fields. Default values are before_filename and after_filename respectively.
Remove some Kept items.
Only keep at most before Kept items before Added and Removed items. Only keep at most after Kept items after Added and Removed items.
Default value for before and after is 3.
Output a diff if there are differences.
Usage: output output_line show_item diff
If diff.different is false, this does nothing. Else, it prints diff.before and diff.after, followed by diff.merged. Printing is done using output_line.
Same as output using Log.log, for string diffs.