Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

containsExactly creates ArrayIndexOutOfBoundsException #185

Closed
mschirmacher opened this issue Apr 26, 2019 · 0 comments · Fixed by #187
Closed

containsExactly creates ArrayIndexOutOfBoundsException #185

mschirmacher opened this issue Apr 26, 2019 · 0 comments · Fixed by #187
Labels

Comments

@mschirmacher
Copy link

mschirmacher commented Apr 26, 2019

This test case reproduces the error:

    @Test
    fun foo() {
        assertThat(listOf("1", "2", "3")).containsExactly("2", "3", "1")
    }

Both lists are of same size, contain the same elements in the same order except on the first element of the actual list which is expected to be at the end of the list:

Caused by: java.lang.ArrayIndexOutOfBoundsException: -1
	at assertk.assertions.support.ListDiffer.backtrack(ListDiffer.kt:87)
	at assertk.assertions.support.ListDiffer.diff(ListDiffer.kt:10)
	at assertk.assertions.ListKt.listDifferExpected(list.kt:48)
	at assertk.assertions.ListKt.containsExactly(list.kt:44)
	... 24 more

tests with assertk 0.13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants