ref: a6d844a9a5bc0c52a6bd4a97d0d15e9ce0a5acaf
parent: bee62076c6cd8d54997a50061f8bd1ce082159d8
author: Rangi <35663410+Rangi42@users.noreply.github.com>
date: Fri Feb 19 11:34:21 EST 2021
Add more test cases for IF, REPT, and MACRO (#748)
--- /dev/null
+++ b/test/asm/code-after-endm-endr-endc.asm
@@ -1,0 +1,27 @@
+println "start"
+
+; will not define 'mac'
+mac: MACRO
+ println \1
+ENDM println "<_<"
+ mac "argument"
+
+; will not repeat
+REPT 3
+ println "hey!"
+ENDR println "<_<"
+
+IF 0
+ println "skipped"
+ bad syntax!?
+ELSE println "<_<"
+ println "else clause"
+ENDC println "<_<"
+
+IF 1
+ println "if clause"
+ELSE println "<_<"
+ println "not skipped"
+ENDC println "<_<"
+
+println "done"
--- /dev/null
+++ b/test/asm/code-after-endm-endr-endc.err
@@ -1,0 +1,15 @@
+ERROR: code-after-endm-endr-endc.asm(6):
+ syntax error, unexpected PRINTLN, expecting newline
+ERROR: code-after-endm-endr-endc.asm(7):
+ Macro "mac" not defined
+ERROR: code-after-endm-endr-endc.asm(12):
+ syntax error, unexpected PRINTLN, expecting newline
+ERROR: code-after-endm-endr-endc.asm(17):
+ syntax error, unexpected PRINTLN, expecting newline
+ERROR: code-after-endm-endr-endc.asm(19):
+ syntax error, unexpected PRINTLN, expecting end of file or newline
+ERROR: code-after-endm-endr-endc.asm(23):
+ syntax error, unexpected PRINTLN, expecting newline
+ERROR: code-after-endm-endr-endc.asm(25):
+ syntax error, unexpected PRINTLN, expecting end of file or newline
+error: Assembly aborted (7 errors)!
--- /dev/null
+++ b/test/asm/code-after-endm-endr-endc.out
@@ -1,0 +1,5 @@
+start
+else clause
+if clause
+not skipped
+done
--- /dev/null
+++ b/test/asm/multiple-else.asm
@@ -1,0 +1,18 @@
+if 0
+ println "zero"
+else
+ println "one"
+ if 1
+ println "A"
+ else
+ println "B"
+ else
+ println "C"
+ else
+ println "D"
+ endc
+else
+ println "two"
+else
+ println "three"
+endc
--- /dev/null
+++ b/test/asm/multiple-else.out
@@ -1,0 +1,2 @@
+one
+A