assertContentEquals
Asserts that the expected iterable is structurally equal to the actual iterable, with an optional message.
Two iterables are considered structurally equal if they have the same size, and elements at corresponding positions, following the iteration order, are equal. Elements are compared for equality using the equals function. For floating point numbers, this means NaN
is equal to itself and -0.0
is not equal to 0.0
.
The iterables are also considered equal if both are null
.
Since Kotlin
1.5Asserts that the expected sequence is structurally equal to the actual sequence, with an optional message.
Two sequences are considered structurally equal if they have the same size, and elements at corresponding positions, following the iteration order, are equal. Elements are compared for equality using the equals function. For floating point numbers, this means NaN
is equal to itself and -0.0
is not equal to 0.0
.
The sequences are also considered equal if both are null
.
Since Kotlin
1.5Asserts that the expected array is structurally equal to the actual array, with an optional message.
Two arrays are considered structurally equal if they have the same size, and elements at corresponding indices are equal. Elements are compared for equality using the equals function. For floating point numbers, this means NaN
is equal to itself and -0.0
is not equal to 0.0
.
The arrays are also considered equal if both are null
.
Since Kotlin
1.5Asserts that the expected array is structurally equal to the actual array, with an optional message.
Two arrays are considered structurally equal if they have the same size, and elements at corresponding indices are equal.
The arrays are also considered equal if both are null
.
Since Kotlin
1.5Deprecated (with error)
'assertContentEquals' for Set arguments is ambiguous. Use 'assertEquals' to compare content with the unordered set equality, or cast one of arguments to Iterable to compare the set elements in order of iteration.
Replace with
assertContentEquals(expected, actual?.asIterable(), message)