diff options
author | Kyle Gunger <kgunger12@gmail.com> | 2024-03-25 16:37:07 -0400 |
---|---|---|
committer | Kyle Gunger <kgunger12@gmail.com> | 2024-03-25 16:37:07 -0400 |
commit | 00f4940ff1c19f3659779b2db078b85f178cb5ab (patch) | |
tree | c7aca037e64dbe184085e7342c187eef5ffb3c40 /tests | |
parent | 8f86708daa697274a39f8b0af42291a4ed4573eb (diff) |
More tests, dec and inc postfix
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_basic_2.tnsl | 5 | ||||
-rw-r--r-- | tests/test_conditional_2.tnsl | 11 | ||||
-rw-r--r-- | tests/test_conditional_3.tnsl | 10 | ||||
-rw-r--r-- | tests/test_pointer_4.tnsl | 14 |
4 files changed, 40 insertions, 0 deletions
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 +;/ + |