From 137a9db6718d3e7a432a7393520251b0a34c7ba9 Mon Sep 17 00:00:00 2001 From: Olaf Seibert Date: Thu, 4 Jun 2015 12:11:14 +0200 Subject: [PATCH] More tests. Refine string delimiter test for .ASCII a bit. Make the delimiters for .INCLUDE and .LIBRARY accept the same delimiters (= is not disallowed, it just makes the line look like an assignment). --- parse.c | 4 +++- tests/RunTests | 1 + tests/test-asciz.mac | 16 ++++++++++++---- tests/test-include.mac | 4 ++-- tests/test-psect.mac | 12 ++++++++++++ 5 files changed, 30 insertions(+), 7 deletions(-) create mode 100644 tests/test-psect.mac diff --git a/parse.c b/parse.c index cbe38eb..2dbefc3 100644 --- a/parse.c +++ b/parse.c @@ -83,6 +83,9 @@ char *getstring( * but not * .include ^/name/ name =name= :name: * .include :name: seems to be silently ignored. + * + * This should probably follow the exact same rules as .ASCII + * although that is not mentioned in the manual, */ char *getstring_fn( char *cp, @@ -94,7 +97,6 @@ char *getstring_fn( switch (*cp) { case '<': - case '=': case ':': return NULL; } diff --git a/tests/RunTests b/tests/RunTests index 7f96aaf..2645b3f 100755 --- a/tests/RunTests +++ b/tests/RunTests @@ -16,6 +16,7 @@ TESTS="test-asciz \ test-jmp \ test-locals \ test-macro-comma \ + test-psect \ test-undef \ test-word-comma" diff --git a/tests/test-asciz.mac b/tests/test-asciz.mac index 21ba652..bb71638 100644 --- a/tests/test-asciz.mac +++ b/tests/test-asciz.mac @@ -6,7 +6,15 @@ CR = 13. LF = 10. SOH = 1 - .asciz // ; 2 bytes and a string - .asciz // ; only a string - .asciz || ; the same string - .asciz ; 3 bytes + .asciz // ; 2 bytes and a string + .asciz // ; only a string + .asciz || ; the same string + .ascii ; 3 bytes + + .asciz ;ABC;/DEF/ ; ABCDEF, not recommended practice + .asciz /ABC/;DEF; ; ABC, not recommended practice + .asciz /ABC/=DEF= ; ABCDEF, not recommended practice + .asciz =DEF= ; syntax error: assignment + .asciz =###= ; syntax error: assignment + .asciz :SOH: ; syntax error: colon not allowed + .asciz :###: ; syntax error: colon not allowed diff --git a/tests/test-include.mac b/tests/test-include.mac index 9ee3b5e..0cf5393 100644 --- a/tests/test-include.mac +++ b/tests/test-include.mac @@ -13,5 +13,5 @@ .include .include