diff options
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 +;/ + |