Diff Module
Helpers for generating short human-readable diffs for assertion and property failures.
Functions and values
| Function or value |
Description
|
Full Usage:
Diff.array expected actual
Parameters:
'T array
-
The expected array.
actual : 'T array
-
The observed array.
Returns: string option
Some human-readable explanation when the arrays differ; otherwise None.
|
Describes a mismatch between two arrays.
|
|
The default diff settings used by Testify expectations.
Example
val options: obj
|
Full Usage:
Diff.list expected actual
Parameters:
'T list
-
The expected list.
actual : 'T list
-
The observed list.
Returns: string option
Some human-readable explanation when the lists differ; otherwise None.
|
Describes a mismatch between two lists.
|
Full Usage:
Diff.option expected actual
Parameters:
'T option
-
The expected option value.
actual : 'T option
-
The observed option value.
Returns: string option
Some human-readable explanation when the options differ; otherwise None.
|
Describes a mismatch between two option values.
|
Full Usage:
Diff.seq expected actual
Parameters:
'T seq
-
The expected sequence.
actual : 'T seq
-
The observed sequence.
Returns: string option
Some human-readable explanation when the sequences differ; otherwise None.
|
Describes a mismatch between two sequences.
|
Full Usage:
Diff.string expected actual
Parameters:
string
-
The expected string.
actual : string
-
The observed string.
Returns: string option
Some human-readable explanation when the strings differ; otherwise None.
|
Describes a string mismatch, including the first differing character when possible.
|
Full Usage:
Diff.tryDescribe expected actual
Parameters:
'T
-
The expected value.
actual : 'T
-
The observed value.
Returns: string option
Some explanation when the values differ and Testify can describe the mismatch;
otherwise None.
|
Attempts a mismatch description using
Example
val description: obj
|
Full Usage:
Diff.tryDescribeFast expected actual
Parameters:
'T
-
The expected value.
actual : 'T
-
The observed value.
Returns: string option
Some human-readable explanation when a lightweight diff strategy can explain the mismatch;
otherwise None.
|
Attempts a lightweight mismatch description without structural diffing.
|
Full Usage:
Diff.tryDescribeStructural expected actual
Parameters:
'T
-
The expected value.
actual : 'T
-
The observed value.
Returns: string option
Some structural diff text when Diffract can explain the mismatch; otherwise None.
|
Attempts a structural mismatch description using Diffract.
|
Full Usage:
Diff.tryDescribeWith options expected actual
Parameters:
DiffOptions
-
The diff configuration controlling strategy and truncation.
expected : 'T
-
The expected value.
actual : 'T
-
The observed value.
Returns: string option
Some explanation when the values differ and the chosen diff strategy can describe the mismatch;
otherwise None.
|
Attempts a mismatch description using the supplied diff options.
|
testify