exclude more
This commit is contained in:
parent
7090c17f5b
commit
fb3d05ad24
|
@ -314,7 +314,7 @@ proc sample[T](x: ref T; s: var Sampler; r: var Rand; res: var int) =
|
||||||
proc sample[S, T](x: array[S, T]; s: var Sampler; r: var Rand; res: var int) =
|
proc sample[S, T](x: array[S, T]; s: var Sampler; r: var Rand; res: var int) =
|
||||||
when compiles(mutate(x, 0, false, r)):
|
when compiles(mutate(x, 0, false, r)):
|
||||||
sampleAttempt(attempt(s, r, DefaultMutateWeight, res))
|
sampleAttempt(attempt(s, r, DefaultMutateWeight, res))
|
||||||
when T isnot ByteSized:
|
when T isnot SomeNumber|bool|char:
|
||||||
for i in low(x)..high(x):
|
for i in low(x)..high(x):
|
||||||
sample(x[i], s, r, res)
|
sample(x[i], s, r, res)
|
||||||
|
|
||||||
|
@ -410,7 +410,7 @@ proc pick[S, T](x: var array[S, T]; sizeIncreaseHint: int; enforceChanges: bool;
|
||||||
r: var Rand; res: var int) =
|
r: var Rand; res: var int) =
|
||||||
when compiles(mutate(x, sizeIncreaseHint, enforceChanges, r)):
|
when compiles(mutate(x, sizeIncreaseHint, enforceChanges, r)):
|
||||||
pickMutate(mutate(x, sizeIncreaseHint, enforceChanges, r))
|
pickMutate(mutate(x, sizeIncreaseHint, enforceChanges, r))
|
||||||
when T isnot ByteSized:
|
when T isnot SomeNumber|bool|char:
|
||||||
for i in low(x)..high(x):
|
for i in low(x)..high(x):
|
||||||
pick(x[i], sizeIncreaseHint, enforceChanges, r, res)
|
pick(x[i], sizeIncreaseHint, enforceChanges, r, res)
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,6 @@ proc mutate(value: var DiceFace; sizeIncreaseHint: int; enforceChanges: bool; r:
|
||||||
repeatMutate(r.sample([df1, df2, df3, df4, df5, df6]))
|
repeatMutate(r.sample([df1, df2, df3, df4, df5, df6]))
|
||||||
|
|
||||||
func fuzzTarget(x: array[10, DiceFace]) =
|
func fuzzTarget(x: array[10, DiceFace]) =
|
||||||
doAssert x != array[10, DiceFace]([0, 32, 2, 4, 8, 4, 32, 8, 16, 2])
|
doAssert x != [df1, df6, df2, df3, df4, df3, df6, df4, df5, df2]
|
||||||
|
|
||||||
defaultMutator(fuzzTarget)
|
defaultMutator(fuzzTarget)
|
||||||
|
|
Loading…
Reference in New Issue