summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorKyle Gunger <kgunger12@gmail.com>2024-03-12 01:18:46 -0400
committerKyle Gunger <kgunger12@gmail.com>2024-03-12 01:18:46 -0400
commitca9e965a7756b2a7f8de645f53b66dd96c4f279b (patch)
treeb4026b3422b0e20dc81fbf655357bb3510ad1203 /tests
parent644a06a5b13b5a129528618050a9dff4f5281be8 (diff)
Better pointer handling
Diffstat (limited to 'tests')
-rw-r--r--tests/test_method_2.tnsl17
-rw-r--r--tests/test_pointer_2.tnsl6
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
+;/