diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_blank_funcall.tnsl | 11 | ||||
-rw-r--r-- | tests/test_conditional.tnsl | 14 | ||||
-rw-r--r-- | tests/test_funcall.tnsl | 1 | ||||
-rw-r--r-- | tests/test_method.tnsl | 1 |
4 files changed, 26 insertions, 1 deletions
diff --git a/tests/test_blank_funcall.tnsl b/tests/test_blank_funcall.tnsl new file mode 100644 index 0000000..aa955d8 --- /dev/null +++ b/tests/test_blank_funcall.tnsl @@ -0,0 +1,11 @@ + +int out = 0 + +/; func + out = 69 +;/ + +/; main [int] + func() + return out +;/ diff --git a/tests/test_conditional.tnsl b/tests/test_conditional.tnsl new file mode 100644 index 0000000..b82ac75 --- /dev/null +++ b/tests/test_conditional.tnsl @@ -0,0 +1,14 @@ +/; main [int] + + /; if (false) + return 1 + ;; else if (1 == 2) + return 2 + ;; else if (true) + return 69 + ;; else + return 3 + ;/ + + return 0 +;/ diff --git a/tests/test_funcall.tnsl b/tests/test_funcall.tnsl index d741031..c2414fe 100644 --- a/tests/test_funcall.tnsl +++ b/tests/test_funcall.tnsl @@ -7,7 +7,6 @@ ;/ /; main [int] - int i = ret_a() return i + ret_b(60) ;/ diff --git a/tests/test_method.tnsl b/tests/test_method.tnsl index 0f79400..8301e01 100644 --- a/tests/test_method.tnsl +++ b/tests/test_method.tnsl @@ -16,6 +16,7 @@ struct Vector { /; main [int] Vector a + a.init() return a.size |