diff options
-rw-r--r-- | tests/test_funcall_3.tnsl | 9 | ||||
-rw-r--r-- | tests/test_funcall_4.tnsl | 16 | ||||
-rw-r--r-- | tests/test_pointer.tnsl | 11 |
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 ;/ |