aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--travis/test/iftoken.asm315
-rw-r--r--travis/test/iftoken.bin.t26
-rw-r--r--travis/test/iftoken.json11
3 files changed, 352 insertions, 0 deletions
diff --git a/travis/test/iftoken.asm b/travis/test/iftoken.asm
new file mode 100644
index 00000000..f4e955ea
--- /dev/null
+++ b/travis/test/iftoken.asm
@@ -0,0 +1,315 @@
+%define ZMACRO
+%define NMACRO 1
+%define TMACRO 1 2
+ db 'N "":'
+%iftoken
+ db ' token'
+%else
+ db ' ntoken'
+%endif
+%ifempty
+ db ' empty'
+%else
+ db ' nempty'
+%endif
+ db 10
+ db 'C "":'
+%iftoken ; With a comment!
+ db ' token'
+%else
+ db ' ntoken'
+%endif
+%ifempty ; With a comment!
+ db ' empty'
+%else
+ db ' nempty'
+%endif
+ db 10
+ db 'N "ZMACRO":'
+%iftoken ZMACRO
+ db ' token'
+%else
+ db ' ntoken'
+%endif
+%ifempty ZMACRO
+ db ' empty'
+%else
+ db ' nempty'
+%endif
+ db 10
+ db 'C "ZMACRO":'
+%iftoken ZMACRO ; With a comment!
+ db ' token'
+%else
+ db ' ntoken'
+%endif
+%ifempty ZMACRO ; With a comment!
+ db ' empty'
+%else
+ db ' nempty'
+%endif
+ db 10
+ db 'N "NMACRO":'
+%iftoken NMACRO
+ db ' token'
+%else
+ db ' ntoken'
+%endif
+%ifempty NMACRO
+ db ' empty'
+%else
+ db ' nempty'
+%endif
+ db 10
+ db 'C "NMACRO":'
+%iftoken NMACRO ; With a comment!
+ db ' token'
+%else
+ db ' ntoken'
+%endif
+%ifempty NMACRO ; With a comment!
+ db ' empty'
+%else
+ db ' nempty'
+%endif
+ db 10
+ db 'N "TMACRO":'
+%iftoken TMACRO
+ db ' token'
+%else
+ db ' ntoken'
+%endif
+%ifempty TMACRO
+ db ' empty'
+%else
+ db ' nempty'
+%endif
+ db 10
+ db 'C "TMACRO":'
+%iftoken TMACRO ; With a comment!
+ db ' token'
+%else
+ db ' ntoken'
+%endif
+%ifempty TMACRO ; With a comment!
+ db ' empty'
+%else
+ db ' nempty'
+%endif
+ db 10
+ db 'N "1":'
+%iftoken 1
+ db ' token'
+%else
+ db ' ntoken'
+%endif
+%ifempty 1
+ db ' empty'
+%else
+ db ' nempty'
+%endif
+ db 10
+ db 'C "1":'
+%iftoken 1 ; With a comment!
+ db ' token'
+%else
+ db ' ntoken'
+%endif
+%ifempty 1 ; With a comment!
+ db ' empty'
+%else
+ db ' nempty'
+%endif
+ db 10
+ db 'N "+1":'
+%iftoken +1
+ db ' token'
+%else
+ db ' ntoken'
+%endif
+%ifempty +1
+ db ' empty'
+%else
+ db ' nempty'
+%endif
+ db 10
+ db 'C "+1":'
+%iftoken +1 ; With a comment!
+ db ' token'
+%else
+ db ' ntoken'
+%endif
+%ifempty +1 ; With a comment!
+ db ' empty'
+%else
+ db ' nempty'
+%endif
+ db 10
+ db 'N "1 2":'
+%iftoken 1 2
+ db ' token'
+%else
+ db ' ntoken'
+%endif
+%ifempty 1 2
+ db ' empty'
+%else
+ db ' nempty'
+%endif
+ db 10
+ db 'C "1 2":'
+%iftoken 1 2 ; With a comment!
+ db ' token'
+%else
+ db ' ntoken'
+%endif
+%ifempty 1 2 ; With a comment!
+ db ' empty'
+%else
+ db ' nempty'
+%endif
+ db 10
+ db 'N "1,2":'
+%iftoken 1,2
+ db ' token'
+%else
+ db ' ntoken'
+%endif
+%ifempty 1,2
+ db ' empty'
+%else
+ db ' nempty'
+%endif
+ db 10
+ db 'C "1,2":'
+%iftoken 1,2 ; With a comment!
+ db ' token'
+%else
+ db ' ntoken'
+%endif
+%ifempty 1,2 ; With a comment!
+ db ' empty'
+%else
+ db ' nempty'
+%endif
+ db 10
+ db 'N "foo":'
+%iftoken foo
+ db ' token'
+%else
+ db ' ntoken'
+%endif
+%ifempty foo
+ db ' empty'
+%else
+ db ' nempty'
+%endif
+ db 10
+ db 'C "foo":'
+%iftoken foo ; With a comment!
+ db ' token'
+%else
+ db ' ntoken'
+%endif
+%ifempty foo ; With a comment!
+ db ' empty'
+%else
+ db ' nempty'
+%endif
+ db 10
+ db 'N "foo bar":'
+%iftoken foo bar
+ db ' token'
+%else
+ db ' ntoken'
+%endif
+%ifempty foo bar
+ db ' empty'
+%else
+ db ' nempty'
+%endif
+ db 10
+ db 'C "foo bar":'
+%iftoken foo bar ; With a comment!
+ db ' token'
+%else
+ db ' ntoken'
+%endif
+%ifempty foo bar ; With a comment!
+ db ' empty'
+%else
+ db ' nempty'
+%endif
+ db 10
+ db 'N "%":'
+%iftoken %
+ db ' token'
+%else
+ db ' ntoken'
+%endif
+%ifempty %
+ db ' empty'
+%else
+ db ' nempty'
+%endif
+ db 10
+ db 'C "%":'
+%iftoken % ; With a comment!
+ db ' token'
+%else
+ db ' ntoken'
+%endif
+%ifempty % ; With a comment!
+ db ' empty'
+%else
+ db ' nempty'
+%endif
+ db 10
+ db 'N "+foo":'
+%iftoken +foo
+ db ' token'
+%else
+ db ' ntoken'
+%endif
+%ifempty +foo
+ db ' empty'
+%else
+ db ' nempty'
+%endif
+ db 10
+ db 'C "+foo":'
+%iftoken +foo ; With a comment!
+ db ' token'
+%else
+ db ' ntoken'
+%endif
+%ifempty +foo ; With a comment!
+ db ' empty'
+%else
+ db ' nempty'
+%endif
+ db 10
+ db 'N "<<":'
+%iftoken <<
+ db ' token'
+%else
+ db ' ntoken'
+%endif
+%ifempty <<
+ db ' empty'
+%else
+ db ' nempty'
+%endif
+ db 10
+ db 'C "<<":'
+%iftoken << ; With a comment!
+ db ' token'
+%else
+ db ' ntoken'
+%endif
+%ifempty << ; With a comment!
+ db ' empty'
+%else
+ db ' nempty'
+%endif
+ db 10
diff --git a/travis/test/iftoken.bin.t b/travis/test/iftoken.bin.t
new file mode 100644
index 00000000..dbc06bba
--- /dev/null
+++ b/travis/test/iftoken.bin.t
@@ -0,0 +1,26 @@
+N "": ntoken empty
+C "": ntoken empty
+N "ZMACRO": ntoken empty
+C "ZMACRO": ntoken empty
+N "NMACRO": token nempty
+C "NMACRO": token nempty
+N "TMACRO": ntoken nempty
+C "TMACRO": ntoken nempty
+N "1": token nempty
+C "1": token nempty
+N "+1": ntoken nempty
+C "+1": ntoken nempty
+N "1 2": ntoken nempty
+C "1 2": ntoken nempty
+N "1,2": ntoken nempty
+C "1,2": ntoken nempty
+N "foo": token nempty
+C "foo": token nempty
+N "foo bar": ntoken nempty
+C "foo bar": ntoken nempty
+N "%": token nempty
+C "%": token nempty
+N "+foo": ntoken nempty
+C "+foo": ntoken nempty
+N "<<": token nempty
+C "<<": token nempty
diff --git a/travis/test/iftoken.json b/travis/test/iftoken.json
new file mode 100644
index 00000000..57ac110e
--- /dev/null
+++ b/travis/test/iftoken.json
@@ -0,0 +1,11 @@
+[
+ {
+ "description": "Test iftoken directive",
+ "id": "iftoken",
+ "format": "bin",
+ "source": "iftoken.asm",
+ "target": [
+ { "output": "iftoken.bin" }
+ ]
+ }
+]