From efdcf6119e5de99a837189a06a2a23a088432f2d Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Mon, 9 Jan 2023 17:12:43 +0530 Subject: feat: wow --- examples/test-runner.ts | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 examples/test-runner.ts (limited to 'examples/test-runner.ts') diff --git a/examples/test-runner.ts b/examples/test-runner.ts new file mode 100644 index 0000000..c0eb4c4 --- /dev/null +++ b/examples/test-runner.ts @@ -0,0 +1,35 @@ +import { DefineEffect, Do, Effect, Print, PutString, PutStringLn } from '../stdlib' + +type Testi = [ + PutStringLn, + ...effs, +] + +type Equals = + [Left] extends [Right] ? ([Right] extends [Left] ? true : false) : false + +interface Assert<_B extends true> extends Effect { } + +type testCases = [ + ...Testi<"should do some stuff", [ + Assert>, + ]>, + + ...Testi<"hello world", [ + Print<2>, + ]>, + + ...Testi<"should do some other stuff", [ + Print<5>, + ]>, +] + +export type main = [ + DefineEffect<'Assert', `(b) => { + if (!b.getLiteralValue()) { + throw new Error('AAAAAAA') + } + }`>, + PutStringLn<"Running tests...">, + Do, +] -- cgit v1.3.1