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

first() does not print expected for empty lists #287

Open
robd opened this issue Mar 21, 2023 · 0 comments
Open

first() does not print expected for empty lists #287

robd opened this issue Mar 21, 2023 · 0 comments

Comments

@robd
Copy link
Contributor

robd commented Mar 21, 2023

  @Test
  fun `first() handles empty lists`() {
    val subject = emptyList<String>()
    expectThat(subject).first().isEqualTo("catflap")
  }

Fails with the message:

Mapping 'first element %s' failed with: List is empty.
Mapping 'first element %s' failed with: List is empty.
	at app//strikt.internal.AssertionBuilder.get(AssertionBuilder.kt:108)

Wonder if it is possible to show the expected - it can be hard to know which assertion failed if there is more than one 'first()' in a test.

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

No branches or pull requests

1 participant