1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

http: refactor and reduce duplication

This commit is contained in:
Chris Watson
2020-01-16 10:16:11 -07:00
committed by Alexander Medvednikov
parent 756c6d2858
commit 84a6c019e8
8 changed files with 274 additions and 88 deletions

View File

@@ -28,3 +28,11 @@ fn test_str() {
}
assert url.str() == 'https://en.wikipedia.org/wiki/Brazil_(1985_film)'
}
fn test_escape_unescape() {
original := 'те ст: т\\%'
escaped := urllib.query_escape(original)
assert escaped == '%D1%82%D0%B5+%D1%81%D1%82%3A+%D1%82%5C%25'
unescaped := urllib.query_unescape(escaped) or { assert false return }
assert unescaped == original
}