File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
pulsar-common/src/test/kotlin/ai/platon/pulsar/common Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -122,6 +122,20 @@ class TestString {
122
122
}
123
123
}
124
124
125
+ @Test
126
+ fun testReplaceInURL () {
127
+ val url = " https://github.com/platonai/PulsarRPA/releases/download/v3.0.14/PulsarRPA.jar"
128
+ val expectedURL = " https://github.com/platonai/PulsarRPA/releases/download/v3.0.15/PulsarRPA.jar"
129
+ val regex = " https?:.+(v\\ d+\\ .\\ d+\\ .\\ d+).+" .toRegex()
130
+ val replacement = " v3.0.15"
131
+
132
+ val newURL = regex.replace(url) { matchResult ->
133
+ url.replace(matchResult.groupValues[1 ], replacement)
134
+ }
135
+
136
+ assertEquals(expectedURL, newURL)
137
+ }
138
+
125
139
@Test
126
140
fun testAvailableCharsets () {
127
141
var charsets = Charset .availableCharsets().values.stream()
You can’t perform that action at this time.
0 commit comments