summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorKyle Gunger <corechg@gmail.com>2020-09-20 18:18:26 -0400
committerKyle Gunger <corechg@gmail.com>2020-09-20 18:18:26 -0400
commit4adc90d9a8e48a5c1841874cae0cb30c3deee6e1 (patch)
tree4025660d2f9cf825a3b6bf080c590f02405657bf /tests
parent99a037c68522a9ff74449a6aa41c546d85d1bc15 (diff)
Basic updates
- Move preprocessor to it's own file - Begin working on new delimiters - Begin working on blocks in the tree
Diffstat (limited to 'tests')
-rw-r--r--tests/block-test.tnsl29
-rw-r--r--tests/comment-test.tnsl16
-rw-r--r--tests/literal-test.tnsl4
-rw-r--r--tests/parameter-test.tnsl2
-rwxr-xr-xtests/run-tests.sh3
5 files changed, 30 insertions, 24 deletions
diff --git a/tests/block-test.tnsl b/tests/block-test.tnsl
index a05ca60..e5c3aaf 100644
--- a/tests/block-test.tnsl
+++ b/tests/block-test.tnsl
@@ -1,33 +1,26 @@
-;int i = 0
-
/;if (i==0)
;i = 2
-
;/
-/;else
- ;i = 0
-;/
+/: import
+ "this"
+ "that"
+:/
# ;; can be used as a quick block re-definition
/;if (i==0)
;i = 2
-
;;else
;i = 0
-
;/
-/;if
- ;char ch = '\n'
-
-;;else
- ;int it = 90
-
-;/
+# Comment block switching
-/;main
- ;
-
+/; if (i == 2)
+ ;i = 4
+;#
+ Comment
+#; else
+ ;i = 6
;/ \ No newline at end of file
diff --git a/tests/comment-test.tnsl b/tests/comment-test.tnsl
index fe07b45..cdd33be 100644
--- a/tests/comment-test.tnsl
+++ b/tests/comment-test.tnsl
@@ -11,12 +11,20 @@ a/#
Ok, so this should give no output either
#/
-#;
+# ;
#a
# /;
-;#
+; # stuff
a#
/;#
-#;/
-;/ \ No newline at end of file
+# ;/
+;/
+
+# More intricate block changing checks
+
+/# Comment start
+Comment end #; if (thing)
+;; else if (other_thing)
+;# Comment start
+End #/ \ No newline at end of file
diff --git a/tests/literal-test.tnsl b/tests/literal-test.tnsl
index b447e57..e3b73da 100644
--- a/tests/literal-test.tnsl
+++ b/tests/literal-test.tnsl
@@ -1,6 +1,6 @@
# These should all work
-;string s = "\""
-;string st="\\"
+;[]char s = "\""
+;[]char st="\\"
;int i = 0
;int j=1
diff --git a/tests/parameter-test.tnsl b/tests/parameter-test.tnsl
new file mode 100644
index 0000000..c969427
--- /dev/null
+++ b/tests/parameter-test.tnsl
@@ -0,0 +1,2 @@
+/; loop (int initial = 0, int complex = 2) [initial < max || complex < 40, initial++, complex += 7, another += 2]
+;/
diff --git a/tests/run-tests.sh b/tests/run-tests.sh
index 0bc57b0..6f49335 100755
--- a/tests/run-tests.sh
+++ b/tests/run-tests.sh
@@ -12,4 +12,7 @@ PARSEFILE=comment
parse
PARSEFILE=literal
+parse
+
+PARSEFILE=parameter
parse \ No newline at end of file