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

Diagram is shown twice when using kotlin.check #106

Closed
rocketraman opened this issue May 2, 2024 · 3 comments
Closed

Diagram is shown twice when using kotlin.check #106

rocketraman opened this issue May 2, 2024 · 3 comments

Comments

@rocketraman
Copy link

When doing tests in commonTest we don't have access to kotlin.assert, which appears to only be available on JVM and native.

So, I tried to use check instead, which works, but shows the diagram twice:

  @Test
  fun foo() {
    check("foo" == "bar") { "Failed foo=bar" }
  }
Failed foo=bar
check("foo" == "bar") { "Failed foo=bar" }
            |
            false
java.lang.IllegalStateException: Failed foo=bar
check("foo" == "bar") { "Failed foo=bar" }
            |
            false

Also shows twice if the lazyMessage param is not given.

@bnorm
Copy link
Owner

bnorm commented May 2, 2024

I think this may be an IDE oddity, rather than something specific to kotlin-power-assert. I think your IDE (looks like an output from IntelliJ) is showing you the message of the exception the test is failing with and then dumping the stacktrace of the exception which also includes the error message. I suspect if you remove kotlin-power-assert from your build you will observe the same behavior, just without the diagram.

@rocketraman
Copy link
Author

I think this may be an IDE oddity, rather than something specific to kotlin-power-assert.

Yep, you're right. Weird that I've never noticed that before. Sorry for the noise!

@rocketraman
Copy link
Author

rocketraman commented May 2, 2024

More context if anyone else comes upon this in the future:

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

2 participants