From 00f4940ff1c19f3659779b2db078b85f178cb5ab Mon Sep 17 00:00:00 2001 From: Kyle Gunger Date: Mon, 25 Mar 2024 16:37:07 -0400 Subject: More tests, dec and inc postfix --- tests/test_basic_2.tnsl | 5 +++++ tests/test_conditional_2.tnsl | 11 +++++++++++ tests/test_conditional_3.tnsl | 10 ++++++++++ tests/test_pointer_4.tnsl | 14 ++++++++++++++ 4 files changed, 40 insertions(+) create mode 100644 tests/test_basic_2.tnsl create mode 100644 tests/test_conditional_2.tnsl create mode 100644 tests/test_conditional_3.tnsl create mode 100644 tests/test_pointer_4.tnsl (limited to 'tests') diff --git a/tests/test_basic_2.tnsl b/tests/test_basic_2.tnsl new file mode 100644 index 0000000..9f19415 --- /dev/null +++ b/tests/test_basic_2.tnsl @@ -0,0 +1,5 @@ +/; main [int] + int i = 68 + i++ + return i +;/ diff --git a/tests/test_conditional_2.tnsl b/tests/test_conditional_2.tnsl new file mode 100644 index 0000000..ac29d44 --- /dev/null +++ b/tests/test_conditional_2.tnsl @@ -0,0 +1,11 @@ +/; main [int] + int a, b + a = 69 + b = 0 + + /; if (a > b) + return a + ;/ + + return b +;/ diff --git a/tests/test_conditional_3.tnsl b/tests/test_conditional_3.tnsl new file mode 100644 index 0000000..3387d84 --- /dev/null +++ b/tests/test_conditional_3.tnsl @@ -0,0 +1,10 @@ +/; main [int] + + int i = 0 + + /; loop (int j = 0; j < 70) [j++] + i = j + ;/ + + return i +;/ diff --git a/tests/test_pointer_4.tnsl b/tests/test_pointer_4.tnsl new file mode 100644 index 0000000..f128285 --- /dev/null +++ b/tests/test_pointer_4.tnsl @@ -0,0 +1,14 @@ +/; set (int` i) + i = 69 +;/ + +/; set_b (int` j) + set(j) +;/ + +/; main [int] + int k = 0 + set_b(~k) + return k +;/ + -- cgit v1.2.3