< prev index next >

test/jdk/java/util/regex/RegExTest.java

Print this page
rev 55876 : imported patch 8228352-CANON_EQ-breaks-when-pattern-contains-supplementary-codepoint

@@ -33,11 +33,11 @@
  * 6350801 6676425 6878475 6919132 6931676 6948903 6990617 7014645 7039066
  * 7067045 7014640 7189363 8007395 8013252 8013254 8012646 8023647 6559590
  * 8027645 8035076 8039124 8035975 8074678 6854417 8143854 8147531 7071819
  * 8151481 4867170 7080302 6728861 6995635 6736245 4916384 6328855 6192895
  * 6345469 6988218 6693451 7006761 8140212 8143282 8158482 8176029 8184706
- * 8194667 8197462 8184692 8221431 8224789
+ * 8194667 8197462 8184692 8221431 8224789 8228352
  *
  * @library /test/lib
  * @library /lib/testlibrary/java/lang
  * @build jdk.test.lib.RandomFactory
  * @run main RegExTest

@@ -183,10 +183,11 @@
         embeddedFlags();
         grapheme();
         expoBacktracking();
         invalidGroupName();
         illegalRepetitionRange();
+        surrogatePairWithCanonEq();
 
         if (failure) {
             throw new
                 RuntimeException("RegExTest failed, 1st failure: " +
                                  firstFailure);

@@ -4971,6 +4972,16 @@
                 System.out.println("Unexpected exception: " + t);
             }
         }
         report("illegalRepetitionRange");
     }
+
+    private static void surrogatePairWithCanonEq() {
+        try {
+            Pattern.compile("\ud834\udd21", Pattern.CANON_EQ);
+        } catch (Throwable t) {
+            failCount++;
+            System.out.println("Unexpected exception: " + t);
+        }
+        report("surrogatePairWithCanonEq");
+    }
 }
< prev index next >