diff options
author | Kyle Gunger <kgunger12@gmail.com> | 2024-03-12 01:18:46 -0400 |
---|---|---|
committer | Kyle Gunger <kgunger12@gmail.com> | 2024-03-12 01:18:46 -0400 |
commit | ca9e965a7756b2a7f8de645f53b66dd96c4f279b (patch) | |
tree | b4026b3422b0e20dc81fbf655357bb3510ad1203 /tests | |
parent | 644a06a5b13b5a129528618050a9dff4f5281be8 (diff) |
Better pointer handling
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_method_2.tnsl | 17 | ||||
-rw-r--r-- | tests/test_pointer_2.tnsl | 6 |
2 files changed, 23 insertions, 0 deletions
diff --git a/tests/test_method_2.tnsl b/tests/test_method_2.tnsl new file mode 100644 index 0000000..899cdcb --- /dev/null +++ b/tests/test_method_2.tnsl @@ -0,0 +1,17 @@ +struct Vector { + ~void data, + int count, size, _elsz +} + +/; method Vector + + /; init (int elsz) + self._elsz = elsz + ;/ +;/ + +/; main [int] + Vector a + a.init(1) + return a._elsz +;/ diff --git a/tests/test_pointer_2.tnsl b/tests/test_pointer_2.tnsl new file mode 100644 index 0000000..5fe1a36 --- /dev/null +++ b/tests/test_pointer_2.tnsl @@ -0,0 +1,6 @@ +/; main [int] + int i = 0 + ~int j = ~i + j` = 69 + return i +;/ |