summaryrefslogtreecommitdiff
path: root/pbt/ts/src/index.ts
diff options
context:
space:
mode:
Diffstat (limited to 'pbt/ts/src/index.ts')
-rw-r--r--pbt/ts/src/index.ts20
1 files changed, 20 insertions, 0 deletions
diff --git a/pbt/ts/src/index.ts b/pbt/ts/src/index.ts
new file mode 100644
index 0000000..3a71ccf
--- /dev/null
+++ b/pbt/ts/src/index.ts
@@ -0,0 +1,20 @@
+type Result = 'OK' | 'Falsified' | 'Exception';
+
+type TestResult<A> = {
+ result: Result,
+ seed: number,
+ counterexample: A | null
+};
+
+type Predicate<A> = (a: A) => boolean;
+
+type Gen<A> = (s: number) => (() => A);
+
+type Shrinker<A> = (a: A) => [A];
+
+function property<A>(seed: number,
+ predicate: Predicate<A>,
+ generator: Gen<A>,
+ shrinker: Shrinker<A>): TestResult<A> {
+ return {result: 'OK', seed, counterexample: null};
+}