--- a/test/langtools/tools/javac/expswitch/ExpSwitchNestingTest.java Thu Dec 13 17:01:15 2018 +0100
+++ b/test/langtools/tools/javac/expswitch/ExpSwitchNestingTest.java Thu Dec 13 19:06:11 2018 +0100
@@ -75,6 +75,8 @@
}
}
+ private static String[] PREVIEW_OPTIONS = {"--enable-preview", "-source", "13"};
+
private void program(String... constructs) {
String s = "class C { static boolean cond = false; static int x = 0; void m() { # } }";
for (String c : constructs)
@@ -84,7 +86,7 @@
private void assertOK(String... constructs) {
reset();
- addCompileOptions("--enable-preview", "-source", "12");
+ addCompileOptions(PREVIEW_OPTIONS);
program(constructs);
try {
compile();
@@ -97,7 +99,7 @@
private void assertOKWithWarning(String warning, String... constructs) {
reset();
- addCompileOptions("--enable-preview", "-source", "12");
+ addCompileOptions(PREVIEW_OPTIONS);
program(constructs);
try {
compile();
@@ -110,7 +112,7 @@
private void assertFail(String expectedDiag, String... constructs) {
reset();
- addCompileOptions("--enable-preview", "-source", "12");
+ addCompileOptions(PREVIEW_OPTIONS);
program(constructs);
try {
compile();