2019-08-06 06:54:47 +03:00
|
|
|
import net.urllib
|
2019-08-06 18:31:45 +03:00
|
|
|
//import http
|
2019-07-31 14:38:24 +03:00
|
|
|
|
|
|
|
fn test_escape_unescape() {
|
2019-08-06 06:54:47 +03:00
|
|
|
/*
|
2019-07-31 14:38:24 +03:00
|
|
|
original := 'те ст: т\\%'
|
2019-08-06 06:54:47 +03:00
|
|
|
escaped := urllib.query_escape(original) or { assert false return}
|
2019-07-31 14:38:24 +03:00
|
|
|
assert escaped == '%D1%82%D0%B5%20%D1%81%D1%82%3A%20%D1%82%5C%25'
|
2019-08-06 06:54:47 +03:00
|
|
|
unescaped := urllib.query_unescape(escaped) or { assert false return }
|
2019-07-31 14:38:24 +03:00
|
|
|
assert unescaped == original
|
2019-08-06 06:54:47 +03:00
|
|
|
*/
|
2019-07-31 14:38:24 +03:00
|
|
|
}
|
2019-08-05 11:42:58 +03:00
|
|
|
|
2019-08-06 14:57:58 +03:00
|
|
|
fn test_http_get() {
|
2019-08-06 18:31:45 +03:00
|
|
|
/*
|
2019-08-06 15:15:42 +03:00
|
|
|
$if windows { return }
|
2019-08-06 14:57:58 +03:00
|
|
|
assert http.get_text('https://vlang.io/version') == '0.1.5'
|
|
|
|
println('http ok')
|
2019-08-06 18:31:45 +03:00
|
|
|
*/
|
2019-08-06 14:57:58 +03:00
|
|
|
}
|
|
|
|
|