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

all: bring back panic(err.msg) -> panic(err) (#9022)

This commit is contained in:
spaceface
2021-03-01 00:18:14 +01:00
committed by GitHub
parent ce115dcbe0
commit b712af56fd
110 changed files with 383 additions and 387 deletions

View File

@ -34,7 +34,7 @@ fn http_fetch_mock(_methods []string, _config FetchConfig) ?[]Response {
fn test_http_fetch_bare() {
$if !network ? { return }
responses := http_fetch_mock([], FetchConfig{}) or {
panic(err.msg)
panic(err)
}
for response in responses {
assert response.status_code == 200
@ -46,11 +46,11 @@ fn test_http_fetch_with_data() {
responses := http_fetch_mock(['POST', 'PUT', 'PATCH', 'DELETE'], {
data: 'hello world'
}) or {
panic(err.msg)
panic(err)
}
for response in responses {
payload := json.decode(HttpbinResponseBody,response.text) or {
panic(err.msg)
panic(err)
}
assert payload.data == 'hello world'
}
@ -64,11 +64,11 @@ fn test_http_fetch_with_params() {
'c': 'd'
}
}) or {
panic(err.msg)
panic(err)
}
for response in responses {
// payload := json.decode(HttpbinResponseBody,response.text) or {
// panic(err.msg)
// panic(err)
// }
assert response.status_code == 200
// TODO
@ -84,11 +84,11 @@ fn test_http_fetch_with_headers() {
'Test-Header': 'hello world'
}
}) or {
panic(err.msg)
panic(err)
}
for response in responses {
// payload := json.decode(HttpbinResponseBody,response.text) or {
// panic(err.msg)
// panic(err)
// }
assert response.status_code == 200
// TODO

View File

@ -16,7 +16,7 @@ fn test_http_get_from_vlang_utc_now() {
for url in urls {
println('Test getting current time from $url by http.get')
res := http.get(url) or {
panic(err.msg)
panic(err)
}
assert 200 == res.status_code
assert res.text.len > 0
@ -40,7 +40,7 @@ fn test_public_servers() {
for url in urls {
println('Testing http.get on public url: $url ')
res := http.get(url) or {
panic(err.msg)
panic(err)
}
assert 200 == res.status_code
assert res.text.len > 0
@ -54,7 +54,7 @@ fn test_relative_redirects() {
return
} // tempfix periodic: httpbin relative redirects are broken
res := http.get('https://httpbin.org/relative-redirect/3?abc=xyz') or {
panic(err.msg)
panic(err)
}
assert 200 == res.status_code
assert res.text.len > 0