-
-
Notifications
You must be signed in to change notification settings - Fork 763
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ICU-22984 Generate old Java monkeys #3301
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Error: RBBITestMonkey.TestLineMonkey:1694->RunMonkey:1459 » IllegalArgument Rule $NU × ($AL | $HL) found a break at a position which does not correspond to an index in the original string
Error: RBBITestMonkey.TestRTLineMonkey:1763->RunMonkey:1459 » IllegalArgument Rule $NU × ($AL | $HL) found a break at a position which does not correspond to an index in the original string
icu4j/main/core/src/test/java/com/ibm/icu/dev/test/rbbi/RBBITestMonkey.java
Outdated
Show resolved
Hide resolved
icu4j/main/core/src/test/java/com/ibm/icu/dev/test/rbbi/RemapRule.java
Outdated
Show resolved
Hide resolved
changes lgtm but the CI check still fails |
works in Java 11, 17, 21, but fails in Java 8; some Java regex behavior change? maybe skip these tests on Java 8?? |
Well, I ended up narrowing down the Java 8 inconsistency to something about surrogates, so I changed the code to not produce nor match them before Java 9. |
@@ -1433,6 +1433,12 @@ void RunMonkey(BreakIterator bi, RBBIMonkeyKind mk, String name, int seed, int | |||
if (c < 0) { // TODO: deal with sets containing strings. | |||
errln("c < 0"); | |||
} | |||
// Do not emit surrogates on Java 8, as the behaviour of regular expressions that | |||
// match surrogates differs there. | |||
if (System.getProperty("java.version").startsWith("1.") && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please pull the System.getProperty() and version check out of the loop.
// Do not emit surrogates on Java 8, as the behaviour of regular expressions that | ||
// match surrogates differs there. | ||
if (System.getProperty("java.version").startsWith("1.") && | ||
Character.isSurrogate((char)c)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also triggers for U+1D800, U+2D800, ...
Please check Character.isBmpCodePoint(c) first.
(Don't ask me why isSurrogate() does not take an int code point.)
Copied from the C++ in #3287 and hammered upon until it compiled and passed.
Checklist