Adds treatment for the transition between ASCII and non-ASCII in the middle of urls
This commit is contained in:
+1
-2
@@ -37,9 +37,8 @@ class UrlMarkerTest {
|
||||
indices: IntArray,
|
||||
) {
|
||||
val urlMarker = UrlMarker()
|
||||
urlMarker.originalUrl = testString
|
||||
urlMarker.setIndices(indices)
|
||||
val url = urlMarker.createUrl()
|
||||
val url = urlMarker.createUrl(testString)
|
||||
assertEquals(url.host, host, "host, " + testString)
|
||||
assertEquals(url.path, path, "path, " + testString)
|
||||
assertEquals(url.scheme, scheme, "scheme, " + testString)
|
||||
|
||||
+7
@@ -735,6 +735,13 @@ class UriDetectionTest {
|
||||
runTest("I saw this on http://[::1]:3000 I think it is really cool", "http://[::1]:3000")
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testNoSchemaUrlMultibyteAscii() {
|
||||
runTest("ほtest.com", "test.com")
|
||||
runTest("test.comほ", "test.com")
|
||||
runTest("ほtest.comほ", "test.com")
|
||||
}
|
||||
|
||||
private fun runTest(
|
||||
text: String,
|
||||
vararg expected: String?,
|
||||
|
||||
Reference in New Issue
Block a user