2021-04-12 19:32:51 +03:00
|
|
|
module context
|
|
|
|
|
|
|
|
fn test_background() {
|
|
|
|
ctx := background()
|
2023-06-27 01:25:45 +03:00
|
|
|
assert '&context.Background' == ctx.str()
|
2021-04-12 19:32:51 +03:00
|
|
|
if _ := ctx.value('') {
|
2021-04-25 16:04:07 +03:00
|
|
|
panic('This should never happen')
|
2021-04-12 19:32:51 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn test_todo() {
|
|
|
|
ctx := todo()
|
2023-06-27 01:25:45 +03:00
|
|
|
assert '&context.TODO' == ctx.str()
|
2021-04-12 19:32:51 +03:00
|
|
|
if _ := ctx.value('') {
|
2021-04-25 16:04:07 +03:00
|
|
|
panic('This should never happen')
|
2021-04-12 19:32:51 +03:00
|
|
|
}
|
|
|
|
}
|