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

net: vfmt everything

This commit is contained in:
Delyan Angelov
2021-06-14 10:08:41 +03:00
parent 535dcac8fa
commit d7d9305d96
13 changed files with 387 additions and 215 deletions

View File

@@ -15,9 +15,7 @@ fn test_http_get_from_vlang_utc_now() {
urls := ['http://vlang.io/utc_now', 'https://vlang.io/utc_now']
for url in urls {
println('Test getting current time from $url by http.get')
res := http.get(url) or {
panic(err)
}
res := http.get(url) or { panic(err) }
assert 200 == res.status_code
assert res.text.len > 0
assert res.text.int() > 1566403696
@@ -39,9 +37,7 @@ fn test_public_servers() {
]
for url in urls {
println('Testing http.get on public url: $url ')
res := http.get(url) or {
panic(err)
}
res := http.get(url) or { panic(err) }
assert 200 == res.status_code
assert res.text.len > 0
}
@@ -53,9 +49,7 @@ fn test_relative_redirects() {
} $else {
return
} // tempfix periodic: httpbin relative redirects are broken
res := http.get('https://httpbin.org/relative-redirect/3?abc=xyz') or {
panic(err)
}
res := http.get('https://httpbin.org/relative-redirect/3?abc=xyz') or { panic(err) }
assert 200 == res.status_code
assert res.text.len > 0
assert res.text.contains('"abc": "xyz"')