From 8c3ca462fe5339ecf95e7a9d9c279b84352493c6 Mon Sep 17 00:00:00 2001 From: Sylvie <35663410+Rangi42@users.noreply.github.com> Date: Mon, 17 Jun 2024 15:07:35 -0400 Subject: [PATCH] Add more test cases (#1409) --- test/asm/character-escape-at-end.asm | 1 + test/asm/character-escape-at-end.err | 5 +++++ test/asm/character-escape-at-end.out | 1 + test/asm/macro-args-outside-macro.asm | 3 +++ test/asm/macro-args-outside-macro.err | 7 +++++++ test/asm/macro-args-outside-macro.out | 3 +++ test/link/script-syntax-error.link | 7 +++++++ test/link/script-syntax-error.out | 3 +++ 8 files changed, 30 insertions(+) create mode 100644 test/asm/character-escape-at-end.asm create mode 100644 test/asm/character-escape-at-end.err create mode 100644 test/asm/character-escape-at-end.out create mode 100644 test/asm/macro-args-outside-macro.asm create mode 100644 test/asm/macro-args-outside-macro.err create mode 100644 test/asm/macro-args-outside-macro.out create mode 100644 test/link/script-syntax-error.link create mode 100644 test/link/script-syntax-error.out diff --git a/test/asm/character-escape-at-end.asm b/test/asm/character-escape-at-end.asm new file mode 100644 index 00000000..7dc75f30 --- /dev/null +++ b/test/asm/character-escape-at-end.asm @@ -0,0 +1 @@ +println "hello\ \ No newline at end of file diff --git a/test/asm/character-escape-at-end.err b/test/asm/character-escape-at-end.err new file mode 100644 index 00000000..78234958 --- /dev/null +++ b/test/asm/character-escape-at-end.err @@ -0,0 +1,5 @@ +error: character-escape-at-end.asm(1): + Illegal character escape at end of input +error: character-escape-at-end.asm(1): + Unterminated string +error: Assembly aborted (2 errors)! diff --git a/test/asm/character-escape-at-end.out b/test/asm/character-escape-at-end.out new file mode 100644 index 00000000..b556e7a6 --- /dev/null +++ b/test/asm/character-escape-at-end.out @@ -0,0 +1 @@ +hello\ diff --git a/test/asm/macro-args-outside-macro.asm b/test/asm/macro-args-outside-macro.asm new file mode 100644 index 00000000..d580293e --- /dev/null +++ b/test/asm/macro-args-outside-macro.asm @@ -0,0 +1,3 @@ + println \1 + println \<2> + println \# diff --git a/test/asm/macro-args-outside-macro.err b/test/asm/macro-args-outside-macro.err new file mode 100644 index 00000000..0612739e --- /dev/null +++ b/test/asm/macro-args-outside-macro.err @@ -0,0 +1,7 @@ +error: macro-args-outside-macro.asm(1): + '\1' cannot be used outside of a macro +error: macro-args-outside-macro.asm(2): + '\<2>' cannot be used outside of a macro +error: macro-args-outside-macro.asm(3): + '\#' cannot be used outside of a macro +error: Assembly aborted (3 errors)! diff --git a/test/asm/macro-args-outside-macro.out b/test/asm/macro-args-outside-macro.out new file mode 100644 index 00000000..b28b04f6 --- /dev/null +++ b/test/asm/macro-args-outside-macro.out @@ -0,0 +1,3 @@ + + + diff --git a/test/link/script-syntax-error.link b/test/link/script-syntax-error.link new file mode 100644 index 00000000..fa2e5f05 --- /dev/null +++ b/test/link/script-syntax-error.link @@ -0,0 +1,7 @@ +rom0 + "ROM0" org 1 + "NONE" optional + +romx "1" +romx 1 + "ROM1" diff --git a/test/link/script-syntax-error.out b/test/link/script-syntax-error.out new file mode 100644 index 00000000..758941a1 --- /dev/null +++ b/test/link/script-syntax-error.out @@ -0,0 +1,3 @@ +error: script-syntax-error.link(2): syntax error, unexpected ORG, expecting newline or OPTIONAL +error: script-syntax-error.link(5): syntax error, unexpected string, expecting newline or number +Linking failed with 2 errors