Skip to content

Commit eb25e29

Browse files
authored
Merge pull request scala#10196 from som-snytt/tweak/target-test
2 parents f8a5497 + 6bcd34d commit eb25e29

File tree

1 file changed

+7
-24
lines changed

1 file changed

+7
-24
lines changed

test/junit/scala/tools/nsc/settings/TargetTest.scala

Lines changed: 7 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import org.junit.runner.RunWith
1818
import org.junit.runners.JUnit4
1919

2020
import scala.collection.mutable.ListBuffer
21+
import scala.tools.nsc.settings.StandardScalaSettings._
2122
import scala.util.Properties.isJavaAtLeast
2223
import scala.util.Try
2324

@@ -53,32 +54,14 @@ class TargetTest {
5354
checkFail("-target:1.9") // it's not Java 1.9, you reprobates!
5455
checkFail("-target:jvm-1.9")
5556

56-
check("-target:jvm-10", "10")
57-
check("-target:10", "10")
58-
59-
check("-target:jvm-11", "11")
60-
check("-target:11", "11")
61-
62-
check("-target:jvm-12", "12")
63-
check("-target:12", "12")
64-
65-
// (scene missing)
66-
67-
check("-target:jvm-16", "16")
68-
check("-target:16", "16")
69-
70-
check("-target:jvm-17", "17")
71-
check("-target:17", "17")
72-
73-
check("-target:jvm-18", "18")
74-
check("-target:18", "18")
75-
76-
check("-target:jvm-19", "19")
77-
check("-target:19", "19")
78-
57+
(MinTargetVersion to MaxTargetVersion).map(_.toString).foreach { v =>
58+
check(s"-target:jvm-$v", v)
59+
check(s"-target:$v", v)
60+
}
61+
checkFail(s"-target:jvm-${MaxTargetVersion+1}")
62+
checkFail(s"-target:${MaxTargetVersion+1}")
7963
checkFail("-target:jvm-6") // no longer
8064
checkFail("-target:jvm-7") // no longer
81-
checkFail("-target:jvm-20") // not yet...
8265
checkFail("-target:jvm-3000") // not in our lifetime
8366
checkFail("-target:msil") // really?
8467
}

0 commit comments

Comments
 (0)