summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pbt/ts/src/index.ts6
-rw-r--r--pbt/ts/src/property.ts3
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++;
}