nim-drchaos/tests/traises.nim
2022-08-25 23:18:38 +03:00

12 lines
272 B
Nim

# 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)