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

Missing test run? #252

Open
anthony-cros opened this issue May 28, 2021 · 0 comments
Open

Missing test run? #252

anthony-cros opened this issue May 28, 2021 · 0 comments

Comments

@anthony-cros
Copy link

I have:

$ cat build.sbt 
libraryDependencies += "com.lihaoyi" %% "utest" % "0.7.10" % "test"
testFrameworks += new TestFramework("utest.runner.Framework")

and

$ cat src/test/scala/HelloTests.scala 
package test.utest.examples
import utest._
object HelloTests extends TestSuite {
  val tests = Tests {
    test {  1  }
    test { "a" }
    test { throw new Exception("foo") }
    test {  2  }
    test { "b" }    
  }
}

and upon running sbt test, I obtain:

...
[info] welcome to sbt 1.4.7 (Oracle Corporation Java 1.8.0_161)
...
[info] compiling 1 Scala source to [...]/target/scala-2.12/test-classes ...
-------------------------------- Running Tests --------------------------------
+ test.utest.examples.HelloTests.0 1ms  1
+ test.utest.examples.HelloTests.1 0ms  a
X test.utest.examples.HelloTests.2 0ms 
  java.lang.Exception: foo
    test.utest.examples.HelloTests$.$anonfun$tests$4(HelloTests.scala:7)
+ test.utest.examples.HelloTests.3 0ms  2
[info] Tests: 4, Passed: 3, Failed: 1
[error] Failed tests:
[error] 	test.utest.examples.HelloTests
[error] (Test / test) sbt.TestsFailedException: Tests unsuccessful
[error] Total time: 2 s, completed May 28, 2021 1:56:11 PM

I would expect there to run five tests, not four. Am I missing something or is this an actual issue?

PS: I actually do care about not having to name my tests (at least not all of them)

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