2019-07-31 13:38:24 +02:00
|
|
|
|
import http
|
|
|
|
|
|
|
|
|
|
fn test_escape_unescape() {
|
|
|
|
|
original := 'те ст: т\\%'
|
2019-07-31 20:53:07 +02:00
|
|
|
|
escaped := http.escape_url(original)
|
2019-07-31 13:38:24 +02:00
|
|
|
|
assert escaped == '%D1%82%D0%B5%20%D1%81%D1%82%3A%20%D1%82%5C%25'
|
2019-07-31 20:53:07 +02:00
|
|
|
|
unescaped := http.unescape_url(escaped)
|
2019-07-31 13:38:24 +02:00
|
|
|
|
assert unescaped == original
|
|
|
|
|
}
|
2019-08-05 10:42:58 +02:00
|
|
|
|
|