blob: c2b4bd912f341d3b48610b690551e2b6afb46f53 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
Assert! we are on
fn errorMakingProc {} {
error "making an error (this is expected & will be caught)"
}
When we are on {
When the time is /t/ {
if {$t % 5 == 0} {
errorMakingProc
}
}
When /someone/ has error /err/ with info /info/ {
set stacktrace [dict get $info -errorinfo]
set filename [lindex $stacktrace 1]
set lineno [lindex $stacktrace 2]
assert {$filename eq "test/backtrace.folk"}
assert {$lineno == 4}
puts "SUCCESS!"
Exit! 0
}
set t 0
while true {
Assert! the time is [incr t]
Retract! the time is [- $t 1]
sleep 0.3
}
}
|