mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
vfmt: change all '$expr' to '${expr}' (#16428)
This commit is contained in:
@@ -41,7 +41,7 @@ fn (mut handler MyHttpHandler) handle(req http.Request) http.Response {
|
||||
handler.counter++
|
||||
// eprintln('$time.now() | counter: $handler.counter | $req.method $req.url\n$req.header\n$req.data - 200 OK\n')
|
||||
mut r := http.Response{
|
||||
body: req.data + ', $req.url'
|
||||
body: req.data + ', ${req.url}'
|
||||
header: req.header
|
||||
}
|
||||
match req.url.all_before('?') {
|
||||
@@ -71,17 +71,17 @@ fn test_server_custom_handler() {
|
||||
for server.status() != .running {
|
||||
time.sleep(10 * time.millisecond)
|
||||
}
|
||||
x := http.fetch(url: 'http://localhost:$cport/endpoint?abc=xyz', data: 'my data')!
|
||||
x := http.fetch(url: 'http://localhost:${cport}/endpoint?abc=xyz', data: 'my data')!
|
||||
assert x.body == 'my data, /endpoint?abc=xyz'
|
||||
assert x.status_code == 200
|
||||
assert x.http_version == '1.1'
|
||||
y := http.fetch(url: 'http://localhost:$cport/another/endpoint', data: 'abcde')!
|
||||
y := http.fetch(url: 'http://localhost:${cport}/another/endpoint', data: 'abcde')!
|
||||
assert y.body == 'abcde, /another/endpoint'
|
||||
assert y.status_code == 200
|
||||
assert y.status() == .ok
|
||||
assert y.http_version == '1.1'
|
||||
//
|
||||
http.fetch(url: 'http://localhost:$cport/something/else')!
|
||||
http.fetch(url: 'http://localhost:${cport}/something/else')!
|
||||
server.stop()
|
||||
t.wait()
|
||||
assert handler.counter == 3
|
||||
|
||||
Reference in New Issue
Block a user