From b47bddf1ecc7f26c488b67477ff074896958b000 Mon Sep 17 00:00:00 2001 From: Peter Geertsema Date: Thu, 12 May 2022 15:46:59 -0400 Subject: [PATCH] test: add tests --- README.md | 5 +++++ tests/abscond/1.wkt | 2 ++ tests/blackmail/1.wkt | 2 ++ tests/blackmail/2.wkt | 2 ++ tests/con/1.wkt | 2 ++ tests/con/2.wkt | 2 ++ 6 files changed, 15 insertions(+) create mode 100644 tests/abscond/1.wkt create mode 100644 tests/blackmail/1.wkt create mode 100644 tests/blackmail/2.wkt create mode 100644 tests/con/1.wkt create mode 100644 tests/con/2.wkt diff --git a/README.md b/README.md index 9a186c4..b645b16 100644 --- a/README.md +++ b/README.md @@ -167,3 +167,8 @@ Some specifics to note: - Just like in class, the cons cell starts with the `cdr` and is followed by the `car` 8 bytes later. - The `StoreHeap` struct requires the address to be on the stack beforehand. This is so the `car` and `cdr` can be stored right next to each other in memory. + +## Compiling a test + +Run `make tests/{folder}/{number}.wasm` to compile to `main.wasm` in the `server/` folder, which can then be run +from the frontend. diff --git a/tests/abscond/1.wkt b/tests/abscond/1.wkt new file mode 100644 index 0000000..877f36f --- /dev/null +++ b/tests/abscond/1.wkt @@ -0,0 +1,2 @@ +#lang wacket +42 \ No newline at end of file diff --git a/tests/blackmail/1.wkt b/tests/blackmail/1.wkt new file mode 100644 index 0000000..002d1cb --- /dev/null +++ b/tests/blackmail/1.wkt @@ -0,0 +1,2 @@ +#lang wacket +(add1 41) \ No newline at end of file diff --git a/tests/blackmail/2.wkt b/tests/blackmail/2.wkt new file mode 100644 index 0000000..444ba24 --- /dev/null +++ b/tests/blackmail/2.wkt @@ -0,0 +1,2 @@ +#lang wacket +(add1 (sub1 42)) \ No newline at end of file diff --git a/tests/con/1.wkt b/tests/con/1.wkt new file mode 100644 index 0000000..0c38b79 --- /dev/null +++ b/tests/con/1.wkt @@ -0,0 +1,2 @@ +#lang wacket +(if (zero? (add1 0)) 69 42) \ No newline at end of file diff --git a/tests/con/2.wkt b/tests/con/2.wkt new file mode 100644 index 0000000..fd75d04 --- /dev/null +++ b/tests/con/2.wkt @@ -0,0 +1,2 @@ +#lang wacket +(if (zero? 0) 42 69) \ No newline at end of file