aboutsummaryrefslogtreecommitdiffstats
path: root/test/e2e/call_stack/test_call_stack.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/e2e/call_stack/test_call_stack.py')
-rw-r--r--test/e2e/call_stack/test_call_stack.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/e2e/call_stack/test_call_stack.py b/test/e2e/call_stack/test_call_stack.py
index 3895f5c..02897f9 100644
--- a/test/e2e/call_stack/test_call_stack.py
+++ b/test/e2e/call_stack/test_call_stack.py
@@ -21,6 +21,12 @@ def run_mul(a: int, b: int) -> int:
return machine.rg.value
+def test_mul_0():
+ expected = 0
+ received = run_mul(0, -100)
+
+ assert expected == received
+
def test_mul_1():
expected = 30
received = run_mul(5, 6)
@@ -32,6 +38,8 @@ def test_mul_2():
b = 200
expected = a * b
received = run_mul(a, b)
+ # interpret received as a 16 bit signed integer, using powers of two in the math
+ received = received if received < 2**15 else received - 2**16
assert expected == received