summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorKyle Gunger <kgunger12@gmail.com>2021-12-03 18:25:03 -0500
committerKyle Gunger <kgunger12@gmail.com>2021-12-03 18:25:03 -0500
commit1100ac865074effb3a4735c7449779f7193b7d0c (patch)
tree1a981ae33b1ba4a888c98640fed0e7fc74b18f57 /tests
parent8fd930180e5d7a610117299bb9c48e28409d3106 (diff)
General updates
+ Fill out eval a little and make sure that this builds. ~ CF kinda broken in AST. Gonna have to fix that. Upcoming Parser update.
Diffstat (limited to 'tests')
-rw-r--r--tests/block-test.tnsl18
-rw-r--r--tests/comment-test.tnsl14
-rw-r--r--tests/literal-test.tnsl10
-rw-r--r--tests/parameter-test.tnsl2
-rw-r--r--tests/statement-test.tnsl2
5 files changed, 24 insertions, 22 deletions
diff --git a/tests/block-test.tnsl b/tests/block-test.tnsl
index c48d7de..2bd4053 100644
--- a/tests/block-test.tnsl
+++ b/tests/block-test.tnsl
@@ -22,10 +22,8 @@
;i = 2
;/
- /: include
- "this"
- "that"
- :/
+ :include "this"
+ :include "that"
# ;; can be used as a quick block re-definition
@@ -53,17 +51,17 @@
/;method Vector2
/; operator + (~Vector2 v)
- ;self.x += v`.x
- ;self.y += v`.y
+ ;self.x = self.x + v`.x
+ ;self.y = self.y + v`.y
;/
/; operator + (int32 a)
- ;self.x += a
- ;self.y += a
+ ;self.x = self.x + a
+ ;self.y = self.y + a
;/
;/
- ;struct FVector2 () {}
+ ;struct FVector2 () {float x, y}
-;/ \ No newline at end of file
+;/
diff --git a/tests/comment-test.tnsl b/tests/comment-test.tnsl
index 6643695..ffc6e3a 100644
--- a/tests/comment-test.tnsl
+++ b/tests/comment-test.tnsl
@@ -14,14 +14,16 @@
limitations under the License.
#/
-;/#
-#/;
+/;/#
+#/;/
+
+;a a
-a/#
+;a/#
#/a
-/;/#
-#/;/
+; /#
+#/;
/#
Ok, so this should give no output either
@@ -43,4 +45,4 @@ a#
Comment end #; if (thing)
;; else if (other_thing)
;# Comment start
-End #/ \ No newline at end of file
+End #/
diff --git a/tests/literal-test.tnsl b/tests/literal-test.tnsl
index 73f5f77..6e55323 100644
--- a/tests/literal-test.tnsl
+++ b/tests/literal-test.tnsl
@@ -28,17 +28,19 @@
# Invalid (some may be weeded out through the verify phase):
-;string s ""
+#;string s ""
-;int 0 i
+#;int 0 i
# Invalid ops should also be detected if dealing with literals
-;char c ~= 's'
+#;char c ~= 's'
# Debate over weather these are legal
-;int k = .1
+#;int k = .1
;int l = 0x01
+;int i
+;a a;
diff --git a/tests/parameter-test.tnsl b/tests/parameter-test.tnsl
index 96f6d41..cae89ab 100644
--- a/tests/parameter-test.tnsl
+++ b/tests/parameter-test.tnsl
@@ -14,5 +14,5 @@
limitations under the License.
#/
;int another = 0
-/; loop (int initial = 0, complex = 2) [initial < max || complex < 40, initial++, complex += 7, another += 2]
+/; loop (int initial = 0, complex = 2) [initial < max || complex < 40; initial++; complex += 7; another += 2]
;/
diff --git a/tests/statement-test.tnsl b/tests/statement-test.tnsl
index 71bd64b..b771e06 100644
--- a/tests/statement-test.tnsl
+++ b/tests/statement-test.tnsl
@@ -3,4 +3,4 @@
/; if_block
;; else_block
-;/ \ No newline at end of file
+;/