aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJulien Dessaux2021-10-05 22:46:37 +0200
committerJulien Dessaux2021-10-05 22:46:37 +0200
commitf6bd9fa1a8e541c4aaae7272f38a6e73e2b3e233 (patch)
tree90f17a8504ddb032c5b9d7ede3958dfb899c19c7 /tests
parentRefactoring (diff)
downloadnimfunge98-f6bd9fa1a8e541c4aaae7272f38a6e73e2b3e233.tar.gz
nimfunge98-f6bd9fa1a8e541c4aaae7272f38a6e73e2b3e233.tar.bz2
nimfunge98-f6bd9fa1a8e541c4aaae7272f38a6e73e2b3e233.zip
Implemented steps over a funge space field
Diffstat (limited to '')
-rw-r--r--tests/field.nim11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/field.nim b/tests/field.nim
index dcb7530..e60887a 100644
--- a/tests/field.nim
+++ b/tests/field.nim
@@ -205,3 +205,14 @@ suite "Field":
])
f.Set(-7, 4, int('y'))
check f == xprependyappend
+ test "Step":
+ var minimal = Load("examples/minimal.b98")
+ var hello = Load("examples/hello.b98")
+ var dna = Load("examples/dna.b98")
+ check minimal[].Step((0, 0), (0, 0)) == (0, 0)
+ check minimal[].Step((0, 0), (1, 0)) == (0, 0)
+ check hello[].Step((3, 0), (0, 0)) == (3, 0)
+ check hello[].Step((3, 0), (1, 0)) == (4, 0)
+ check dna[].Step((1, 2), (3, 5)) == (4, 7)
+ check dna[].Step((6, 1), (1, 1)) == (5, 0)
+ check dna[].Step((1, 4), (-2, 2)) == (5, 0)