summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/test_index.tnsl5
-rw-r--r--tests/test_pointer_5.tnsl21
2 files changed, 26 insertions, 0 deletions
diff --git a/tests/test_index.tnsl b/tests/test_index.tnsl
new file mode 100644
index 0000000..ede9bc2
--- /dev/null
+++ b/tests/test_index.tnsl
@@ -0,0 +1,5 @@
+~uint8 vals = "EBCDE"
+
+/; main [int]
+ return vals{0}
+;/
diff --git a/tests/test_pointer_5.tnsl b/tests/test_pointer_5.tnsl
new file mode 100644
index 0000000..2534dde
--- /dev/null
+++ b/tests/test_pointer_5.tnsl
@@ -0,0 +1,21 @@
+struct Hold {
+ ~~uint8 a,
+ ~uint8 b
+}
+
+/; method Hold
+
+ /; set (~uint8 to_set)
+ self.b = to_set
+ self.a = ~self.b
+ ;/
+;/
+
+/; main [int]
+ uint8 val = 69
+
+ Hold h
+ h.set(~val)
+
+ return h.a``
+;/