Skip to content

Commit

Permalink
Add basic tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
CensoredUsername committed Dec 12, 2024
1 parent f7d1fe1 commit caa988e
Show file tree
Hide file tree
Showing 4 changed files with 46,271 additions and 1 deletion.
25 changes: 24 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
command: check

test:
name: Test Suite
name: Unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand All @@ -30,3 +30,26 @@ jobs:
- uses: actions-rs/cargo@v1
with:
command: test

validate:
name: Run testcases
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Test assembling
run: |
cargo run --release -- testcases/assembly_basic_instructions.wsa -t -f asm -o testcases/assembly_basic_instructions.2.ws
diff -u testcases/assembly_basic_instructions.ws testcases/assembly_basic_instructions.2.ws
- name: Test disassembling
run: |
cargo run --release -- testcases/assembly_basic_instructions.ws -t -f ws -o testcases/assembly_basic_instructions.2.wsa
diff -u testcases/assembly_basic_instructions.wsa testcases/assembly_basic_instructions.2.wsa
- name: Test running a known working whitespace program
run: |
cargo run --release -- testcases/big-quine.ws -o testcases/big-quine.2.ws
diff -u testcases/big-quine.ws testcases/big-quine.2.ws
43 changes: 43 additions & 0 deletions testcases/assembly_basic_instructions.ws
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@











































33 changes: 33 additions & 0 deletions testcases/assembly_basic_instructions.wsa
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
start:
push 0
push 1
push 99
push -1
push -99
dup
copy 1
swap
pop
slide 3
add
sub
mul
div
mod
set
get
test:
call test
_11010110:
jmp _11010110
jz _11010110
jn _11010110
ret
pchr
pnum
ichr
inum
_0:
_:
_1:
exit
Loading

0 comments on commit caa988e

Please sign in to comment.