diff options
author | Julien Dessaux | 2021-10-06 22:06:05 +0200 |
---|---|---|
committer | Julien Dessaux | 2021-10-06 22:06:05 +0200 |
commit | ba8933937e0b24e5a648ec176c4f0b8515fb0e2d (patch) | |
tree | 33ecdbf0e99eeee21a90a66aba21550dee6c6c74 /tests/stackStack.nim | |
parent | Implemented steps over a funge space field (diff) | |
download | nimfunge98-ba8933937e0b24e5a648ec176c4f0b8515fb0e2d.tar.gz nimfunge98-ba8933937e0b24e5a648ec176c4f0b8515fb0e2d.tar.bz2 nimfunge98-ba8933937e0b24e5a648ec176c4f0b8515fb0e2d.zip |
Implemented missing functions for the interpreter
Diffstat (limited to 'tests/stackStack.nim')
-rw-r--r-- | tests/stackStack.nim | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/stackStack.nim b/tests/stackStack.nim index 5451d79..8ff3e62 100644 --- a/tests/stackStack.nim +++ b/tests/stackStack.nim @@ -110,3 +110,42 @@ suite "StackStack": check empty.height == 1 check empty[].Pop() == 1 check empty[].Pop() == 0 + test "Under": + var empty = NewStackStack() + empty[].Push(18) + check empty[].Under() == true + check empty[].Pop() == 18 + empty[].Push(1) + empty[].Push(2) + empty[].Push(3) + empty[].Push(4) + empty[].Push(5) + empty[].Push(6) + empty[].Push(0) + empty[].Begin((7, 8)) + empty[].Push(9) + empty[].Push(0) + check empty[].Under() == false + check empty[].Pop() == 9 + empty[].Push(9) + empty[].Push(2) + check empty[].Under() == false + check empty[].Pop() == 7 + check empty[].Pop() == 8 + check empty[].Pop() == 9 + empty[].Push(9) + empty[].Push(10) + empty[].Push(-3) + check empty[].Under() == false + check empty[].Pop() == 0 + check empty[].Pop() == 0 + check empty[].Pop() == 0 + var v: tuple[x, y: int] + check empty[].End(v) == false + check v.x == 9 + check v.y == 0 + check empty[].Pop() == 10 + check empty[].Pop() == 6 + test "GetHeights": + var empty = NewStackStack() + check empty[].GetHeights == (1, @[0]) |