diff options
| author | Arnaud Bailly <arnaud.bailly@iohk.io> | 2025-01-26 09:10:02 +0100 |
|---|---|---|
| committer | Arnaud Bailly <arnaud.bailly@iohk.io> | 2025-01-26 09:10:02 +0100 |
| commit | fbfaafbc5711368234f9f92ad67ffa03f558a6fb (patch) | |
| tree | a20e3eec9ea687ed4d0a650463bebe99aeeca5ed | |
| parent | 3c4e2ba00776a492a7ccb060435e54b5a34a5188 (diff) | |
| download | lambda-nantes-fbfaafbc5711368234f9f92ad67ffa03f558a6fb.tar.gz | |
Report reverse/reverse property
| -rw-r--r-- | pbt/ts/src/index.ts | 6 | ||||
| -rw-r--r-- | pbt/ts/src/property.ts | 3 |
2 files changed, 5 insertions, 4 deletions
diff --git a/pbt/ts/src/index.ts b/pbt/ts/src/index.ts index cf8b7ff..37ab4c9 100644 --- a/pbt/ts/src/index.ts +++ b/pbt/ts/src/index.ts @@ -91,8 +91,10 @@ let prop_reverse_is_self_inverse = async function main() { let rng = new Prando(Math.random() * 1000); - let result = prop_reverse_with_two_lists(rng, 10); - console.log('result: ' + JSON.stringify(result)); + let reverse_append_result = prop_reverse_with_two_lists(rng, 10); + let reverse_reverse_result = prop_reverse_is_self_inverse(rng, 10); + console.log('result: ' + JSON.stringify(reverse_append_result)); + console.log('result: ' + JSON.stringify(reverse_reverse_result)); } main(); diff --git a/pbt/ts/src/property.ts b/pbt/ts/src/property.ts index 40e32c5..a8c59ba 100644 --- a/pbt/ts/src/property.ts +++ b/pbt/ts/src/property.ts @@ -29,7 +29,6 @@ function findMinimalCounterExample<A>(x: A, let shrinks = depth; for (let y of xs) { if (!predicate(y)) { - console.log("Shrinking with " + y); let shrink = findMinimalCounterExample(y, predicate, shrinker, depth + 1); if (shrink.shrinks > depth) { counterexample = shrink.counterexample; @@ -58,7 +57,7 @@ export function property<A>( let x = gen(size); if (!predicate(x)) { let counterexample = findMinimalCounterExample(x, predicate, shrinker); - return { result: 'Falsified', tests: i, counterexample }; + return { result: 'Falsified', tests: i+1, counterexample }; } size++; } |
