< prev index next >
test/jdk/java/util/regex/RegExTest.java
Print this page
@@ -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
+ * 8194667 8197462 8184692
*
* @library /test/lib
* @build jdk.test.lib.RandomFactory
* @run main RegExTest
* @key randomness
@@ -162,10 +162,11 @@
linebreakTest();
branchTest();
groupCurlyNotFoundSuppTest();
groupCurlyBackoffTest();
patternAsPredicate();
+ patternAsMatchPredicate();
invalidFlags();
embeddedFlags();
grapheme();
expoBacktracking();
invalidGroupName();
@@ -4684,10 +4685,30 @@
failCount++;
}
report("Pattern.asPredicate");
}
+ // This test is for 8184692
+ private static void patternAsMatchPredicate() throws Exception {
+ Predicate<String> p = Pattern.compile("[a-z]+").asMatchPredicate();
+
+ if (p.test("")) {
+ failCount++;
+ }
+ if (!p.test("word")) {
+ failCount++;
+ }
+ if (p.test("1234word")) {
+ failCount++;
+ }
+ if (p.test("1234")) {
+ failCount++;
+ }
+ report("Pattern.asMatchPredicate");
+ }
+
+
// This test is for 8035975
private static void invalidFlags() throws Exception {
for (int flag = 1; flag != 0; flag <<= 1) {
switch (flag) {
case Pattern.CASE_INSENSITIVE:
< prev index next >