mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
context: add a new context module, based on Golang's context, intended to be used in webservers (#9563)
This commit is contained in:
committed by
GitHub
parent
b54188dfea
commit
07a6f4e445
19
vlib/context/empty_test.v
Normal file
19
vlib/context/empty_test.v
Normal file
@@ -0,0 +1,19 @@
|
||||
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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user