@@ -18,6 +18,7 @@ import org.junit.runner.RunWith
1818import org .junit .runners .JUnit4
1919
2020import scala .collection .mutable .ListBuffer
21+ import scala .tools .nsc .settings .StandardScalaSettings ._
2122import scala .util .Properties .isJavaAtLeast
2223import 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