Skip to content

Commit 8adcf6b

Browse files
committed
document last changes and fix tests
1 parent b7d71ed commit 8adcf6b

2 files changed

Lines changed: 25 additions & 11 deletions

File tree

src/changes/changes.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@
88

99
<body>
1010
<release version="3.2.0" date="Mai xx, 2023" description="Bugfixes">
11+
<action type="update" dev="rbri">
12+
Avoid usage of org.w3c.dom.ranges.Range - this is not available on android.
13+
</action>
14+
<action type="add" dev="rbri" issue="583">
15+
Support unicode property escapes in regular expressions.
16+
</action>
1117
<action type="update" dev="rbri">
1218
cssparser: Custom properties without values are valid.
1319
</action>

src/test/java/org/htmlunit/javascript/regexp/RegExpJsToJavaConverter2Test.java

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public void validationPatternUnicodeCodePointEscapesFails() throws Exception {
9393
@Alerts("true")
9494
public void validationPatternUnicodePropertyEscapeLetter() throws Exception {
9595
validation("\\p{L}*", "Html");
96-
validation("\\p{L}*", "&#x043C&#x0439&#x0440");
96+
validation("\\p{L}*", "&#x043C;&#x0439;&#x0440;");
9797
}
9898

9999
/**
@@ -103,12 +103,12 @@ public void validationPatternUnicodePropertyEscapeLetter() throws Exception {
103103
@Alerts("true")
104104
public void validationPatternUnicodePropertyEscapeUppercaseLetter() throws Exception {
105105
validation("\\p{Lu}*", "HTML");
106-
validation("\\p{Lu}*", "&#x041C&#x0419&#x0420");
107-
validation("\\p{uppercase letter}*", "&#x041C&#x0419&#x0420");
108-
validation("\\p{Uppercase Letter}*", "&#x041C&#x0419&#x0420");
109-
validation("\\p{Uppercase_Letter}*", "&#x041C&#x0419&#x0420");
110-
validation("\\p{Uppercase-Letter}*", "&#x041C&#x0419&#x0420");
111-
validation("\\p{uppercaseletter}*", "&#x041C&#x0419&#x0420");
106+
validation("\\p{Lu}*", "&#x041C;&#x0419;&#x0420;");
107+
validation("\\p{uppercase letter}*", "&#x041C;&#x0419;&#x0420");
108+
validation("\\p{Uppercase Letter}*", "&#x041C;&#x0419;&#x0420");
109+
validation("\\p{Uppercase_Letter}*", "&#x041C;&#x0419;&#x0420");
110+
validation("\\p{Uppercase-Letter}*", "&#x041C;&#x0419;&#x0420");
111+
validation("\\p{uppercaseletter}*", "&#x041C;&#x0419;&#x0420");
112112
}
113113

114114
/**
@@ -118,17 +118,25 @@ public void validationPatternUnicodePropertyEscapeUppercaseLetter() throws Excep
118118
@Alerts("true")
119119
public void validationPatternUnicodePropertyEscapeLowercaseLetter() throws Exception {
120120
validation("\\p{Ll}*", "html");
121-
validation("\\p{Ll}*", "&#x043C&#x0439&#x0440");
121+
validation("\\p{Ll}*", "&#x043C;&#x0439;&#x0440;");
122122
}
123123

124124
/**
125125
* @throws Exception if an error occurs
126126
*/
127127
@Test
128-
@Alerts("false")
128+
@Alerts("true")
129129
public void validationPatternUnicodePropertyEscapePrivateUse() throws Exception {
130-
validation("[^\\p{gc=Co}\\p{gc=Cn}]+", "&#xE111");
131-
validation("[^\\p{gc=Co}\\p{gc=Cn}]+", "&#x05FD");
130+
validation("[\\p{gc=Co}]+", "&#xE000;&#xF8FF;");
131+
}
132+
133+
/**
134+
* @throws Exception if an error occurs
135+
*/
136+
@Test
137+
@Alerts("false")
138+
public void validationPatternUnicodePropertyEscapeOther() throws Exception {
139+
validation("^\\p{gc=Cn}", "a");
132140
}
133141

134142
private void validation(final String pattern, final String value) throws Exception {

0 commit comments

Comments
 (0)