I'm testing extensions to ScalaTest (using ScalaTest) with suites such as:
class AssertionsTests extends AnyFunSuite:
test("assertExpr"):
class Tests extends AnyFunSuite:
test("success"):
assertExpr(Seq(1, 2)):
List(1) ::: List(2)
test("failed"):
assertExpr(42, ": not good"):
40 + 1
end Tests
val suite = Tests()
assert(suite.run(Some("success"), silent).succeeds())
assert(!suite.run(Some("failed"), Args(R)).succeeds())
R.lastEvent match
case Some(ev: TestFailed) => assert(ev.message == "Expected 41, but got 42 : not good")
case other => fail(s"unexpected: $other ")
The Mill task test runs AssertionsTests, as it should, but also the inner class Tests (and counts the test "failed" as a failure).
Adding the setting def discoverTestsWithZinc = true solves the problem, but I think inner classes should always be ignored during discovery.
(Maybe it's a ScalaTest (or sbt) issue, but I find it interesting that discoverTestsWithZinc has an impact.)
I'm testing extensions to ScalaTest (using ScalaTest) with suites such as:
The Mill task
testrunsAssertionsTests, as it should, but also the inner classTests(and counts the test"failed"as a failure).Adding the setting
def discoverTestsWithZinc = truesolves the problem, but I think inner classes should always be ignored during discovery.(Maybe it's a ScalaTest (or
sbt) issue, but I find it interesting thatdiscoverTestsWithZinchas an impact.)