From 40c6b840f8078f6a4ac494d30c638696a115f3e2 Mon Sep 17 00:00:00 2001 From: ISSOtm Date: Sun, 21 Feb 2021 03:40:29 +0100 Subject: [PATCH] Add tests for certain directives at EOF without a newline --- test/asm/endc-eof-newline-else.inc | 5 +++++ test/asm/endc-eof-newline.asm | 8 ++++++++ test/asm/endc-eof-newline.err | 0 test/asm/endc-eof-newline.inc | 3 +++ test/asm/endc-eof-newline.out | 3 +++ test/asm/include-eof-newline.asm | 1 + test/asm/include-eof-newline.err | 0 test/asm/include-eof-newline.inc | 1 + test/asm/include-eof-newline.out | 1 + test/asm/syntax-error-eof-newline.asm | 6 ++++++ test/asm/syntax-error-eof-newline.err | 3 +++ test/asm/syntax-error-eof-newline.inc | 1 + test/asm/syntax-error-eof-newline.out | 2 ++ test/asm/syntax-error-eof-newline.simple.err | 3 +++ 14 files changed, 37 insertions(+) create mode 100644 test/asm/endc-eof-newline-else.inc create mode 100644 test/asm/endc-eof-newline.asm create mode 100644 test/asm/endc-eof-newline.err create mode 100644 test/asm/endc-eof-newline.inc create mode 100644 test/asm/endc-eof-newline.out create mode 100644 test/asm/include-eof-newline.asm create mode 100644 test/asm/include-eof-newline.err create mode 100644 test/asm/include-eof-newline.inc create mode 100644 test/asm/include-eof-newline.out create mode 100644 test/asm/syntax-error-eof-newline.asm create mode 100644 test/asm/syntax-error-eof-newline.err create mode 100644 test/asm/syntax-error-eof-newline.inc create mode 100644 test/asm/syntax-error-eof-newline.out create mode 100644 test/asm/syntax-error-eof-newline.simple.err diff --git a/test/asm/endc-eof-newline-else.inc b/test/asm/endc-eof-newline-else.inc new file mode 100644 index 00000000..3c9ed231 --- /dev/null +++ b/test/asm/endc-eof-newline-else.inc @@ -0,0 +1,5 @@ +IF X + PRINTLN "Yes!" +ELSE + PRINTLN "No." +ENDC \ No newline at end of file diff --git a/test/asm/endc-eof-newline.asm b/test/asm/endc-eof-newline.asm new file mode 100644 index 00000000..588f5c8c --- /dev/null +++ b/test/asm/endc-eof-newline.asm @@ -0,0 +1,8 @@ +IF 1 +X = 0 +INCLUDE "endc-eof-newline.inc" +INCLUDE "endc-eof-newline-else.inc" +X = 1 +INCLUDE "endc-eof-newline.inc" +INCLUDE "endc-eof-newline-else.inc" +ENDC \ No newline at end of file diff --git a/test/asm/endc-eof-newline.err b/test/asm/endc-eof-newline.err new file mode 100644 index 00000000..e69de29b diff --git a/test/asm/endc-eof-newline.inc b/test/asm/endc-eof-newline.inc new file mode 100644 index 00000000..f05c3f6e --- /dev/null +++ b/test/asm/endc-eof-newline.inc @@ -0,0 +1,3 @@ +IF X + PRINTLN "Yosh!" +ENDC \ No newline at end of file diff --git a/test/asm/endc-eof-newline.out b/test/asm/endc-eof-newline.out new file mode 100644 index 00000000..68764844 --- /dev/null +++ b/test/asm/endc-eof-newline.out @@ -0,0 +1,3 @@ +No. +Yosh! +Yes! diff --git a/test/asm/include-eof-newline.asm b/test/asm/include-eof-newline.asm new file mode 100644 index 00000000..fa6415da --- /dev/null +++ b/test/asm/include-eof-newline.asm @@ -0,0 +1 @@ +INCLUDE "include-eof-newline.inc" \ No newline at end of file diff --git a/test/asm/include-eof-newline.err b/test/asm/include-eof-newline.err new file mode 100644 index 00000000..e69de29b diff --git a/test/asm/include-eof-newline.inc b/test/asm/include-eof-newline.inc new file mode 100644 index 00000000..24352778 --- /dev/null +++ b/test/asm/include-eof-newline.inc @@ -0,0 +1 @@ + PRINTLN "Hi guys!" diff --git a/test/asm/include-eof-newline.out b/test/asm/include-eof-newline.out new file mode 100644 index 00000000..5cbac9af --- /dev/null +++ b/test/asm/include-eof-newline.out @@ -0,0 +1 @@ +Hi guys! diff --git a/test/asm/syntax-error-eof-newline.asm b/test/asm/syntax-error-eof-newline.asm new file mode 100644 index 00000000..7db76e49 --- /dev/null +++ b/test/asm/syntax-error-eof-newline.asm @@ -0,0 +1,6 @@ +; Syntax errors at the end of a buffer (here, the INCLUDEd file) should be reported in their file, +; not in the parent context (here, this file). + + PRINTLN "Before" + INCLUDE "syntax-error-eof-newline.inc" + PRINTLN "After" diff --git a/test/asm/syntax-error-eof-newline.err b/test/asm/syntax-error-eof-newline.err new file mode 100644 index 00000000..2eaee123 --- /dev/null +++ b/test/asm/syntax-error-eof-newline.err @@ -0,0 +1,3 @@ +ERROR: syntax-error-eof-newline.asm(5) -> syntax-error-eof-newline.inc(1): + syntax error, unexpected newline +error: Assembly aborted (1 errors)! diff --git a/test/asm/syntax-error-eof-newline.inc b/test/asm/syntax-error-eof-newline.inc new file mode 100644 index 00000000..1f6dc36e --- /dev/null +++ b/test/asm/syntax-error-eof-newline.inc @@ -0,0 +1 @@ + SECTION diff --git a/test/asm/syntax-error-eof-newline.out b/test/asm/syntax-error-eof-newline.out new file mode 100644 index 00000000..f3a08f7d --- /dev/null +++ b/test/asm/syntax-error-eof-newline.out @@ -0,0 +1,2 @@ +Before +After diff --git a/test/asm/syntax-error-eof-newline.simple.err b/test/asm/syntax-error-eof-newline.simple.err new file mode 100644 index 00000000..43f74631 --- /dev/null +++ b/test/asm/syntax-error-eof-newline.simple.err @@ -0,0 +1,3 @@ +ERROR: syntax-error-eof-newline.asm(5) -> syntax-error-eof-newline.inc(1): + syntax error +error: Assembly aborted (1 errors)!