Skip to content

Commit

Permalink
Fix wrongly designed constantFrom test
Browse files Browse the repository at this point in the history
Fixes #41
  • Loading branch information
dubzzz committed Feb 19, 2018
1 parent f817c30 commit 9fca382
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/unit/check/arbitrary/ConstantArbitrary.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ describe("ConstantArbitrary", () => {
})
));
it('Should be able to produce all the constants', () => fc.assert(
fc.property(fc.array(fc.string(), 1, 10), fc.integer(), (data, seed) => {
fc.property(fc.array(fc.string(), 1, 10), fc.integer(), fc.nat(), (data, seed, idx) => {
const mrng = stubRng.mutable.fastincrease(seed);
const arb = constantFrom(data[0], ...data.slice(1));
for (let id = 0 ; id != 10000 ; ++id) {
const g = arb.generate(mrng).value;
if (data.indexOf(g) !== -1) return true;
if (g === data[idx % data.length]) return true;
}
return false;
})
Expand Down

0 comments on commit 9fca382

Please sign in to comment.