vxx / vlib / x / async / tests / veb / veb_integration_test.v
19 lines · 18 sloc · 478 bytes · 0b1ee86f742567f2fcb3c534b0a49a6dddba36ab
Raw
1// vtest build: !sanitize-memory-clang
2import context
3import time
4import veb
5import x.async as xasync
6
7fn test_veb_context_response_inside_timeout() {
8 xasync.with_timeout(1 * time.second, fn (mut ctx context.Context) ! {
9 _ = ctx
10 mut web_ctx := veb.Context{}
11 _ := web_ctx.text('hello from veb')
12 if web_ctx.res.status_code != 200 {
13 return error('unexpected veb status')
14 }
15 if web_ctx.res.body != 'hello from veb' {
16 return error('unexpected veb body')
17 }
18 })!
19}
20