Skip to content

Commit 05799a7

Browse files
committed
Enable Scala Native tests with the test command on Scala 3
1 parent 988488f commit 05799a7

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

modules/integration/src/test/scala/scala/cli/integration/TestTestDefinitions.scala

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ abstract class TestTestDefinitions extends ScalaCliSuite with TestScalaVersionAr
8383
| val tests = Tests {
8484
| test("foo") {
8585
| assert(2 + 2 == 4)
86-
| Zone { implicit z =>
86+
| Zone { ${if actualScalaVersion.startsWith("3") then "" else "implicit z =>"}
8787
| val io = StdioHelpers(stdio)
8888
| io.printf(c"%s %s", c"Hello from", c"tests")
8989
| }
@@ -346,10 +346,9 @@ abstract class TestTestDefinitions extends ScalaCliSuite with TestScalaVersionAr
346346
expect(output.contains("Hello from tests"))
347347
}
348348

349-
if (actualScalaVersion.startsWith("2."))
350-
test("successful test native") {
351-
TestUtil.retryOnCi()(successfulNativeTest())
352-
}
349+
test("successful test native") {
350+
TestUtil.retryOnCi()(successfulNativeTest())
351+
}
353352

354353
test("failing test") {
355354
failingTestInputs.fromRoot { root =>
@@ -377,10 +376,9 @@ abstract class TestTestDefinitions extends ScalaCliSuite with TestScalaVersionAr
377376
expect(output.contains("Hello from tests"))
378377
}
379378

380-
if (actualScalaVersion.startsWith("2."))
381-
test("failing test native") {
382-
TestUtil.retryOnCi()(failingNativeTest())
383-
}
379+
test("failing test native") {
380+
TestUtil.retryOnCi()(failingNativeTest())
381+
}
384382

385383
test("failing test return code") {
386384
failingTestInputs.fromRoot { root =>
@@ -448,10 +446,9 @@ abstract class TestTestDefinitions extends ScalaCliSuite with TestScalaVersionAr
448446
}
449447
}
450448

451-
if (actualScalaVersion.startsWith("2."))
452-
test("utest native") {
453-
TestUtil.retryOnCi()(utestNative())
454-
}
449+
test("utest native") {
450+
TestUtil.retryOnCi()(utestNative())
451+
}
455452

456453
test("junit") {
457454
successfulJunitInputs.fromRoot { root =>

0 commit comments

Comments
 (0)