Fix JDK7 failing tests
This commit is contained in:
committed by
Space
parent
81eae94821
commit
33fb49f20d
@@ -41,7 +41,8 @@ public actual val isFloat32RangeEnforced: Boolean = true
|
||||
|
||||
public actual val supportsSuppressedExceptions: Boolean get() = !isJava6
|
||||
|
||||
public actual val supportsNamedCapturingGroup: Boolean get() = !isJava6
|
||||
// Named capturing groups are supported starting from java 7. However, retrieving them by name is not supported in java 7.
|
||||
public actual val supportsNamedCapturingGroup: Boolean get() = isJava8AndAbove
|
||||
|
||||
public actual val supportsOctalLiteralInRegex: Boolean get() = true
|
||||
|
||||
|
||||
@@ -460,13 +460,7 @@ class RegexTest {
|
||||
}
|
||||
|
||||
@Test fun replaceWithNamedGroups() {
|
||||
if (!supportsNamedCapturingGroup) {
|
||||
assertFails {
|
||||
val pattern = Regex("(?<first>\\d+)-(?<second>\\d+)")
|
||||
pattern.replace("123-456", "\${first}+\${second}")
|
||||
}
|
||||
return
|
||||
}
|
||||
if (!supportsNamedCapturingGroup) return
|
||||
|
||||
val pattern = Regex("(?<first>\\d+)-(?<second>\\d+)")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user