| 1 | import context |
| 2 | import time |
| 3 | import veb |
| 4 | import x.async as xasync |
| 5 | |
| 6 | fn test_veb_context_response_inside_timeout() { |
| 7 | xasync.with_timeout(1 * time.second, fn (mut ctx context.Context) ! { |
| 8 | _ = ctx |
| 9 | mut web_ctx := veb.Context{} |
| 10 | _ := web_ctx.text('hello from veb') |
| 11 | if web_ctx.res.status_code != 200 { |
| 12 | return error('unexpected veb status') |
| 13 | } |
| 14 | if web_ctx.res.body != 'hello from veb' { |
| 15 | return error('unexpected veb body') |
| 16 | } |
| 17 | })! |
| 18 | } |
| 19 |