assertk icon indicating copy to clipboard operation
assertk copied to clipboard

containsSubList throws ArrayIndexOutOfBoundsException

Open paulrvvup opened this issue 4 years ago • 1 comments
trafficstars

There are cases where containsSubList throws an ArrayIndexOutOfBoundsException instead of an AssertionError, leading to confusing test failures. For example:

assertThat(listOf(3, 1, 2)).containsSubList(listOf(1, 2, 3))
Index 3 out of bounds for length 3
java.lang.ArrayIndexOutOfBoundsException: Index 3 out of bounds for length 3
	at java.base/java.util.Arrays$ArrayList.get(Arrays.java:4164)
	at assertk.assertions.ListKt.containsSubList(list.kt:77)

paulrvvup avatar Oct 19 '21 10:10 paulrvvup

It looks like this has been fixed? Do you have an ETA on a new release? Thanks!

paulrvvup avatar Oct 26 '21 10:10 paulrvvup

Sorry for the late reply, this has been released

evant avatar Nov 29 '23 02:11 evant