You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by jh...@apache.org on 2019/06/10 17:08:34 UTC

[calcite] branch master updated: Fix test exception caused by slightly different error message from regex in JDK 13

This is an automated email from the ASF dual-hosted git repository.

jhyde pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/calcite.git


The following commit(s) were added to refs/heads/master by this push:
     new 2b91eb2  Fix test exception caused by slightly different error message from regex in JDK 13
2b91eb2 is described below

commit 2b91eb2ee5cbc1e9a6323f98e9628385faf42e1b
Author: Julian Hyde <jh...@apache.org>
AuthorDate: Mon Jun 10 09:39:21 2019 -0700

    Fix test exception caused by slightly different error message from regex in JDK 13
---
 .../apache/calcite/sql/test/SqlOperatorBaseTest.java    | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/core/src/test/java/org/apache/calcite/sql/test/SqlOperatorBaseTest.java b/core/src/test/java/org/apache/calcite/sql/test/SqlOperatorBaseTest.java
index 9a112bf..0edf895 100644
--- a/core/src/test/java/org/apache/calcite/sql/test/SqlOperatorBaseTest.java
+++ b/core/src/test/java/org/apache/calcite/sql/test/SqlOperatorBaseTest.java
@@ -3999,12 +3999,17 @@ public abstract class SqlOperatorBaseTest {
             + "      \\^",
         true);   // illegal range
 
-    tester.checkFails(
-        "'yd3223' similar to '[:LOWER:]{2}[:DIGIT:]{,5}'",
-        "Illegal repetition near index 20\n"
-            + "\\[\\:LOWER\\:\\]\\{2\\}\\[\\:DIGIT\\:\\]\\{,5\\}\n"
-            + "                    \\^",
-        true);
+    // Slightly different error message from JDK 13 onwards
+    final String expectedError =
+        TestUtil.getJavaMajorVersion() >= 13
+            ? "Illegal repetition near index 22\n"
+              + "\\[\\:LOWER\\:\\]\\{2\\}\\[\\:DIGIT\\:\\]\\{,5\\}\n"
+              + "                      \\^"
+            : "Illegal repetition near index 20\n"
+                + "\\[\\:LOWER\\:\\]\\{2\\}\\[\\:DIGIT\\:\\]\\{,5\\}\n"
+                + "                    \\^";
+    tester.checkFails("'yd3223' similar to '[:LOWER:]{2}[:DIGIT:]{,5}'",
+        expectedError, true);
 
     if (Bug.CALCITE_2539_FIXED) {
       tester.checkFails(