2021-04-12 18:32:51 +02:00
|
|
|
module context
|
|
|
|
|
|
|
|
fn test_background() {
|
|
|
|
ctx := background()
|
|
|
|
assert 'context.Background' == ctx.str()
|
|
|
|
if _ := ctx.value('') {
|
2021-04-25 15:04:07 +02:00
|
|
|
panic('This should never happen')
|
2021-04-12 18:32:51 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn test_todo() {
|
|
|
|
ctx := todo()
|
|
|
|
assert 'context.TODO' == ctx.str()
|
|
|
|
if _ := ctx.value('') {
|
2021-04-25 15:04:07 +02:00
|
|
|
panic('This should never happen')
|
2021-04-12 18:32:51 +02:00
|
|
|
}
|
|
|
|
}
|