For this: ``` expectThat(result) { size.isEqua...
# strikt
d
For this:
Copy code
expectThat(result) {
			size.isEqualTo(4)
			withElementAt(3) {
...
I get this:
Copy code
Mapping 'element at index 3 %s' failed with: Index 3 out of bounds for length 3
Mapping 'element at index 3 %s' failed with: Index 3 out of bounds for length 3
	at app//strikt.internal.AssertionBuilder.with(AssertionBuilder.kt:138)
	at app//strikt.assertions.IterableKt.withElementAt(Iterable.kt:70)
Whereas I would have expected the
size.isEqualTo(4)
would give me the size of the array BEFORE crashing on an out of bounds error... or even better, for soft-expectations, maybe not crash at all? Just give an
x
just like any other failed assertion at the appropriate level?
r
This is because you have 2 separate assertion chains. If you construct it as
hasSize(4).elementAt(3)…
it would short circuit