Skip to content

Commit

Permalink
test: add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
peterpie123 committed May 12, 2022
1 parent 6ecd301 commit b47bddf
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
2 changes: 2 additions & 0 deletions tests/abscond/1.wkt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#lang wacket
42
2 changes: 2 additions & 0 deletions tests/blackmail/1.wkt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#lang wacket
(add1 41)
2 changes: 2 additions & 0 deletions tests/blackmail/2.wkt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#lang wacket
(add1 (sub1 42))
2 changes: 2 additions & 0 deletions tests/con/1.wkt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#lang wacket
(if (zero? (add1 0)) 69 42)
2 changes: 2 additions & 0 deletions tests/con/2.wkt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#lang wacket
(if (zero? 0) 42 69)

0 comments on commit b47bddf

Please sign in to comment.