| 1 | // vtest build: !sanitize-memory-clang |
| 2 | import context |
| 3 | import time |
| 4 | import veb |
| 5 | import x.async as xasync |
| 6 | |
| 7 | fn 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 |