regex: Refactor predefined character classes.
This commit is contained in:
+1
-11
@@ -9,21 +9,15 @@ fun codePointToString(codePoint: Int): String {
|
||||
return fromCharArray(charArray, 0, charArray.size)
|
||||
}
|
||||
|
||||
fun box() {}
|
||||
|
||||
// TODO: Here is a performance problem: an execution of this test requires much more time than it in Kotlin/JVM.
|
||||
fun box1() {
|
||||
fun box() {
|
||||
// Regression for HARMONY-3145
|
||||
var p = Regex("(\\p{all})+")
|
||||
var res = true
|
||||
var cnt = 0
|
||||
var s: String
|
||||
for (i in 0..1114111) {
|
||||
if (i % 200000 == 0) {
|
||||
println(i)
|
||||
}
|
||||
s = codePointToString(i)
|
||||
// if (!s.matches(p.toString().toRegex())) { TODO: Uncomment when caching is done.
|
||||
if (!s.matches(p)) {
|
||||
cnt++
|
||||
res = false
|
||||
@@ -37,11 +31,7 @@ fun box1() {
|
||||
cnt = 0
|
||||
|
||||
for (i in 0..1114111) {
|
||||
if (i % 200000 == 0) {
|
||||
println(i)
|
||||
}
|
||||
s = codePointToString(i)
|
||||
// if (!s.matches(p.toString().toRegex())) { TODO: Uncomment when caching is done.
|
||||
if (!s.matches(p)) {
|
||||
cnt++
|
||||
res = false
|
||||
|
||||
Reference in New Issue
Block a user