exclude more

This commit is contained in:
Antonis Geralis 2022-09-14 18:42:56 +03:00
parent 7090c17f5b
commit fb3d05ad24
2 changed files with 3 additions and 3 deletions

View File

@ -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) =
when compiles(mutate(x, 0, false, r)):
sampleAttempt(attempt(s, r, DefaultMutateWeight, res))
when T isnot ByteSized:
when T isnot SomeNumber|bool|char:
for i in low(x)..high(x):
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) =
when compiles(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):
pick(x[i], sizeIncreaseHint, enforceChanges, r, res)

View File

@ -17,6 +17,6 @@ proc mutate(value: var DiceFace; sizeIncreaseHint: int; enforceChanges: bool; r:
repeatMutate(r.sample([df1, df2, df3, df4, df5, df6]))
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)