summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorKyle Gunger <kgunger12@gmail.com>2024-03-12 00:23:28 -0400
committerKyle Gunger <kgunger12@gmail.com>2024-03-12 00:23:28 -0400
commit644a06a5b13b5a129528618050a9dff4f5281be8 (patch)
tree31bf53b6b2555940965abad59346ea8ec6817a1e /tests
parent6ff62d5fe2aebc78b3bc2930c7318d6ce288b61b (diff)
update tests
Diffstat (limited to 'tests')
-rw-r--r--tests/test_funcall_3.tnsl9
-rw-r--r--tests/test_funcall_4.tnsl16
-rw-r--r--tests/test_pointer.tnsl11
3 files changed, 30 insertions, 6 deletions
diff --git a/tests/test_funcall_3.tnsl b/tests/test_funcall_3.tnsl
index b974ea7..0a77bf0 100644
--- a/tests/test_funcall_3.tnsl
+++ b/tests/test_funcall_3.tnsl
@@ -9,8 +9,11 @@ struct Str {
return out
;/
+/; strin (Str in) [int]
+ return in.i
+;/
+
/; main [int]
- Str out
- out = strout()
- return out.j + out.i
+ Str out = strout()
+ return strin(out) + out.j
;/
diff --git a/tests/test_funcall_4.tnsl b/tests/test_funcall_4.tnsl
new file mode 100644
index 0000000..4309766
--- /dev/null
+++ b/tests/test_funcall_4.tnsl
@@ -0,0 +1,16 @@
+struct Dummy {
+ int i, j
+}
+
+/; inout (Dummy in) [Dummy]
+ in.i = 68
+ return in
+;/
+
+/; main [int]
+ Dummy a
+ a.i = 1
+ a.j = 1
+ a = inout(a)
+ return a.i + a.j
+;/
diff --git a/tests/test_pointer.tnsl b/tests/test_pointer.tnsl
index 5fe1a36..1b264b4 100644
--- a/tests/test_pointer.tnsl
+++ b/tests/test_pointer.tnsl
@@ -1,6 +1,11 @@
+struct Dummy {
+ int i, j
+}
+
/; main [int]
- int i = 0
- ~int j = ~i
+ Dummy i
+ i.i = 0
+ ~int j = ~i.i
j` = 69
- return i
+ return i.i
;/