Skip to content

Commit 5ac860c

Browse files
committed
Add integration test to run scala nightly version
1 parent a3ca664 commit 5ac860c

File tree

3 files changed

+55
-1
lines changed

3 files changed

+55
-1
lines changed

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,21 @@ class RunTests212 extends RunTestDefinitions(
3131
)
3232
}
3333
}
34+
test("2.12.nightly") {
35+
TestInputs(os.rel / "sample.sc" -> "println(util.Properties.versionNumberString)").fromRoot {
36+
root =>
37+
val res =
38+
os.proc(
39+
TestUtil.cli,
40+
"run",
41+
".",
42+
"-S",
43+
"2.12.nightly",
44+
TestUtil.extraOptions
45+
)
46+
.call(cwd = root)
47+
val version = res.out.trim()
48+
expect(version.startsWith("2.12"))
49+
}
50+
}
3451
}
Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,27 @@
11
package scala.cli.integration
22

3+
import com.eed3si9n.expecty.Expecty.expect
4+
35
// format: off
46
class RunTests213 extends RunTestDefinitions(
57
scalaVersionOpt = Some(Constants.scala213)
6-
)
8+
){
79
// format: on
10+
test("2.13.nightly") {
11+
TestInputs(os.rel / "sample.sc" -> "println(util.Properties.versionNumberString)").fromRoot {
12+
root =>
13+
val res =
14+
os.proc(
15+
TestUtil.cli,
16+
"run",
17+
".",
18+
"-S",
19+
"2.13.nightly",
20+
TestUtil.extraOptions
21+
)
22+
.call(cwd = root)
23+
val version = res.out.trim()
24+
expect(version.startsWith("2.13"))
25+
}
26+
}
27+
}

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,21 @@ class RunTestsDefault extends RunTestDefinitions(scalaVersionOpt = None) {
4747
archLinuxTest()
4848
}
4949

50+
test("3.nightly") { // should run code using scala 3 nightly version
51+
TestInputs(os.rel / "sample.sc" -> """println("Hello World")""").fromRoot {
52+
root =>
53+
val res =
54+
os.proc(
55+
TestUtil.cli,
56+
"run",
57+
".",
58+
"-S",
59+
"3.nightly",
60+
TestUtil.extraOptions
61+
)
62+
.call(cwd = root)
63+
expect(res.out.trim() == "Hello World")
64+
}
65+
}
66+
5067
}

0 commit comments

Comments
 (0)