nim-drchaos/tests/no_crash/tenums.nim

15 lines
346 B
Nim
Raw Normal View History

2022-08-25 20:18:38 +00:00
# Runs infinitely. Run with a time limit and make sure it doesn't crash.
import drchaos
type
Color = enum
Red, Green, Blue
OtherColor = enum
Cyan, Magenta=2, Yellow=4, Black=8
func fuzzTarget(x: Color) =
doAssert x.ord in low(Color).ord..high(Color).ord
#doAssert x in [Cyan, Magenta, Yellow, Black]
defaultMutator(fuzzTarget)