nim-drchaos/tests/traises.nim

12 lines
272 B
Nim
Raw Permalink Normal View History

2022-08-25 20:18:38 +00:00
# Make sure we catch the exception and it doesn't leak any memory.
# Should print a stack trace in debug mode.
import drchaos
proc testMe(x: int) =
raise newException(ValueError, "Fuzzer test1: " & $x)
func fuzzTarget(x: int) =
testMe(x)
defaultMutator(fuzzTarget)