test/langtools/tools/javac/expswitch/ExpSwitchNestingTest.java
changeset 53023 6879069d9d94
parent 52635 6938c8ef179a
child 53878 4584d0331318
--- 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();