Не подтверждена Коммит a6c519d7 создал по автору spand's avatar spand Зафиксировано автором GitHub
Просмотр файлов

Added additional tests of CodecTest.encodeURLPath() (#2138)

владелец 049d3896
......@@ -60,6 +60,26 @@ class CodecTest {
encodeAndDecodeTest(test)
}
@Test
fun testEncodeURLPathPreservesPercentEncoding() {
val test = "/a/path/with/a%20space/"
assertEquals(test, test.encodeURLPath())
}
@Test
fun testEncodeURLPathPreservesValidPartsAndSlashes() {
val URL_ALPHABET = (('a'..'z') + ('A'..'Z') + ('0'..'9'))
val VALID_PATH_PART = listOf(
':', '@',
'!', '$', '&', '\'', '(', ')', '*', '+', ',', ';', '=',
'-', '.', '_', '~'
)
val preservedSymbols = listOf(URL_ALPHABET, VALID_PATH_PART, listOf("/")).flatten().joinToString("")
val test = "/a/path/$preservedSymbols/"
assertEquals(test, test.encodeURLPath())
}
@Test
fun testSimpleBasicEncodeDecode() {
val s = "simple"
......
Поддерживает Markdown
0% или .
You are about to add 0 people to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Пожалуйста, зарегистрируйтесь или чтобы прокомментировать