Skip to content

Commit

Permalink
🐞[Problem] Array is no longer shrinking
Browse files Browse the repository at this point in the history
[Solution]
Array Shrinker have been disabled in previous refactor. Re-enabled it.
  • Loading branch information
steffnova committed May 16, 2023
1 parent 22c505b commit 79178cf
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions generator/array.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (

"github.com/steffnova/go-check/arbitrary"
"github.com/steffnova/go-check/constraints"
"github.com/steffnova/go-check/shrinker"
)

// Array returns generator for array types. Array element's generator is specified by "element"
Expand Down Expand Up @@ -49,10 +50,12 @@ func ArrayFrom(elements ...arbitrary.Generator) arbitrary.Generator {
value.Index(index).Set(arbitraries[index].Value)
}

return arbitrary.Arbitrary{
arb := arbitrary.Arbitrary{
Value: value,
Elements: arbitraries,
// Shrinker: shrinker.Array(value, shrinkers),
}, nil
}
arb.Shrinker = shrinker.Array(arb)

return arb, nil
}
}

0 comments on commit 79178cf

Please sign in to comment.