You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
▼ Expect that 1:
✓ is equal to 1
▼ Expect that 1:
✗ is equal to 2
found 1
▼ Expect that 1:
✓ is not equal to 3
▼ Expect that 1:
✓ is not equal to 4
▼ Expect that 1:
✓ is equal to 1
▼ Expect that 1:
✗ is equal to 2
found 1
▼ Expect that 1:
✓ is not equal to 3
▼ Expect that 1:
✓ is not equal to 4
at strikt.internal.AssertionStrategy$Throwing.evaluate(AssertionStrategy.kt:160)
at strikt.api.ExpectKt.expect(Expect.kt:27)
at com.example.Test.testMultipleSubject(Test.kt:18)
...
▼ Expect that 1:
✗ is not equal to 1
▼ Expect that 1:
✗ is not equal to 1
at com.example.Test.testSingleSubject(Test.kt:13)
...
Suppressed: org.opentest4j.AssertionFailedError
at strikt.internal.AssertionStrategy.createAssertionFailedError$strikt_core(AssertionStrategy.kt:220)
...
But if I run the test in terminal it's working fine.
(I added testLogging block to show the log in terminal since it does not affect the IntelliJ IDEA output)
> Task :test FAILED
com.example.Test > testMultipleSubject STARTED
com.example.Test > testMultipleSubject FAILED
▼ Expect that 1:
✓ is equal to 1
▼ Expect that 1:
✗ is equal to 2
found 1
▼ Expect that 1:
✓ is not equal to 3
▼ Expect that 1:
✓ is not equal to 4
at strikt.internal.AssertionStrategy$Throwing.evaluate(AssertionStrategy.kt:160)
at strikt.api.ExpectKt.expect(Expect.kt:27)
at com.example.Test.testMultipleSubject(Test.kt:18)
com.example.Test > testSingleSubject STARTED
com.example.Test > testSingleSubject FAILED
▼ Expect that 1:
✗ is not equal to 1
at com.example.Test.testSingleSubject(Test.kt:13)
2 tests completed, 2 failed
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':test'.
IntelliJ IDEA Information
IntelliJ IDEA 2021.3.1 (Community Edition)
Build #IC-213.6461.79, built on December 28, 2021
Runtime version: 11.0.13+7-b1751.21 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Linux 5.4.0-96-generic
GC: G1 Young Generation, G1 Old Generation
Memory: 864M
Cores: 8
Non-Bundled Plugins:
org.jetbrains.kotlin (213-1.6.10-release-923-IJ5744.223)
io.ktor.intellij.plugin (1.5.1-obsolete)
Kotlin: 213-1.6.10-release-923-IJ5744.223
Current Desktop: ubuntu:GNOME
The text was updated successfully, but these errors were encountered:
It is a bit confusing, but actually it is not logged twice.
First the strikt.internal.opentest4j.AssertionFailed.message is logged and then strikt.internal.opentest4j.AssertionFailed stacktrace is printed. Usually, the first line in the stacktrace looks something like this: org.opentest4j.AssertionFailedError: expected: <expected> but was: <actual> (exception class name and the message).
Then the whole thing looks like this:
expected: <expected> but was: <actual>
org.opentest4j.AssertionFailedError: expected: <expected> but was: <actual>
at app//org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
at app//org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
But strikt.internal.opentest4j.AssertionFailed prints only the message without the class name, so it becomes:
expected: <expected> but was: <actual>
expected: <expected> but was: <actual>
at app//org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
at app//org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
Since this message is multiline, it looks as if it was printed twice.
In my opinion, printing the class name in toString() would be consistent with other exception classes.
I don't know if it's considered duplicate from #59, but this is just working with a simple assertion.
build.gradle.kts:
Example code:
Output:
But if I run the test in terminal it's working fine.
(I added
testLogging
block to show the log in terminal since it does not affect the IntelliJ IDEA output)build.gradle.kts:
Command:
Output:
IntelliJ IDEA Information
The text was updated successfully, but these errors were encountered: