Skip to content

Commit

Permalink
tests, tools: add short command tests in v test-all, to ensure `-d …
Browse files Browse the repository at this point in the history
…trace_http_request` and `-d trace_http_response` do not regress (vlang#21981)
  • Loading branch information
spytheman authored Aug 1, 2024
1 parent faea2d9 commit d94473e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions cmd/tools/vtest-all.v
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,22 @@ fn get_all_commands() []Command {
line: '${vexe} install nedpals.args'
okmsg: '`v install` works.'
}
res << Command{
okmsg: 'Running net.http with -d trace_http_request works.'
line: '${vexe} -d trace_http_request -e \'import net.http; x := http.fetch(url: "https://vpm.url4e.com/some/unknown/url")!; println(x.status_code)\''
runcmd: .execute
starts_with: '> GET /some/unknown/url HTTP/1.1'
contains: 'User-Agent: v.http'
ends_with: '404\n'
}
res << Command{
okmsg: 'Running net.http with -d trace_http_response works.'
line: '${vexe} -d trace_http_response -e \'import net.http; x := http.fetch(url: "https://vpm.url4e.com/some/unknown/url")!; println(x.status_code)\''
runcmd: .execute
starts_with: '< HTTP/1.1 404 Not Found'
contains: 'Server: nginx'
ends_with: '404\n'
}
res << Command{
line: '${vexe} -usecache -cg examples/hello_world.v'
okmsg: '`v -usecache -cg` works.'
Expand Down

0 comments on commit d94473e

Please sign in to comment.