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

Failed assertions in Scala 3 produce unhelpful stack traces #354

Open
malcolmredheron opened this issue Dec 25, 2024 · 0 comments
Open

Failed assertions in Scala 3 produce unhelpful stack traces #354

malcolmredheron opened this issue Dec 25, 2024 · 0 comments

Comments

@malcolmredheron
Copy link

I'm confused by the stack traces that I get when a utest assertion fails in scala 3. Specifically, the only line in the trace that refers to the test file seems to point to the line with Tests { on it, not the line of the assertion

I forked the utest repo and changed an assertion to fail. Here's how to reproduce it:

[113/113] utest.jvm[3.3.3].test.testOnly
[113] Setting up CustomFramework
[113] -------------------------------- Running Tests --------------------------------
[113] + test.utest.examples.HelloTests.test1 6ms  
[113] + test.utest.examples.HelloTests.test2.inner 0ms  1
[113] + test.utest.examples.HelloTests.test3 0ms  
[113] X test.utest.examples.HelloTests.test4 3ms 
[113]   utest.AssertionError: 1 == 2
[113]     utest.asserts.Asserts$.assertImpl(Asserts.scala:30)
[113]     test.utest.examples.HelloTests$.$init$$$anonfun$1$$anonfun$4(HelloTests.scala:5)
[113] Tearing down CustomFramework
[113] Tests: 4, Passed: 3, Failed: 1
[113/113] =================================================== utest.jvm[3.3.3].test.testOnly *HelloTests* ====================================================== 1s
1 tasks failed
utest.jvm[3.3.3].test.testOnly 1 tests failed: 
  test.utest.examples.HelloTests test.utest.examples.HelloTests.test4
  • By contrast, ./mill utest.jvm[2.13.14].test.testOnly "*HelloTests*" mentions line 21 instead of line 5
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