private static class ComparisonFailure.ComparisonCompactor
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
private class |
ComparisonFailure.ComparisonCompactor.DiffExtractor |
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
actual |
private int |
contextLength
The maximum length for
expected and actual strings to show. |
private static java.lang.String |
DIFF_END |
private static java.lang.String |
DIFF_START |
private static java.lang.String |
ELLIPSIS |
private java.lang.String |
expected |
Constructor and Description |
---|
ComparisonCompactor(int contextLength,
java.lang.String expected,
java.lang.String actual) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
compact(java.lang.String message) |
private java.lang.String |
sharedPrefix() |
private java.lang.String |
sharedSuffix(java.lang.String prefix) |
private static final java.lang.String ELLIPSIS
private static final java.lang.String DIFF_END
private static final java.lang.String DIFF_START
private final int contextLength
expected
and actual
strings to show. When
contextLength
is exceeded, the Strings are shortened.private final java.lang.String expected
private final java.lang.String actual
public ComparisonCompactor(int contextLength, java.lang.String expected, java.lang.String actual)
contextLength
- the maximum length of context surrounding the difference between the compared strings.
When context length is exceeded, the prefixes and suffixes are compacted.expected
- the expected string valueactual
- the actual string value