mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
20 lines
333 B
V
20 lines
333 B
V
module context
|
|
|
|
fn test_background() {
|
|
ctx := background()
|
|
assert 'context.Background' == ctx.str()
|
|
if _ := ctx.value('') {
|
|
println('This should not happen')
|
|
assert false
|
|
}
|
|
}
|
|
|
|
fn test_todo() {
|
|
ctx := todo()
|
|
assert 'context.TODO' == ctx.str()
|
|
if _ := ctx.value('') {
|
|
println('This should not happen')
|
|
assert false
|
|
}
|
|
}
|