feat: add input validation and stack trace filtering for Timer.sleep
Add type and range checks to Timer.sleep() in both C source and Wren implementation, aborting with descriptive errors for non-numeric or negative arguments. Introduce six new test files covering sleep with fibers, float durations, main fiber, zero milliseconds, negative values, and non-numeric input. Fix stack trace parsing in test runner to skip builtin library frames by iterating through error lines until a main-line match is found.
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
import "timer" for Timer
|
||||
|
||||
IO.print("1") // expect: 1
|
||||
Timer.sleep(3)
|
||||
IO.print("2") // expect: 2
|
||||
Timer.sleep(3)
|
||||
IO.print("3") // expect: 3
|
||||
Timer.sleep(3)
|
||||
IO.print("4") // expect: 4
|
||||
Reference in New Issue
Block a user