diff options
author | Kyle Gunger <kgunger12@gmail.com> | 2024-03-11 04:04:13 -0400 |
---|---|---|
committer | Kyle Gunger <kgunger12@gmail.com> | 2024-03-11 04:04:13 -0400 |
commit | e89df8aad15c2d9a86f9a5bc04657fded6494f17 (patch) | |
tree | 7aef9bdc3aca2d7f5f2044de2206f330dd7ebdea /tests | |
parent | 94263bdaba6e3761eb58d3f6ebf4708d91f2c042 (diff) |
Function call (not working)
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 |