Add tests to improve code coverage
Rangi42 opened this issue · comments
Sylvie commented
Follow-up to #996, lots of particular test gaps discovered by #1221.
Covered by #1257:
- Test more invalid
STRFMT
format strings. - Test expanding macro args or interpolated symbols which contain
\n
\r
\t
characters. - Test illegal character escapes.
- Test line continuations in string literals.
- Try defining a macro inside a
REPT
, and invoke it inside+outside. - Test
BREAK
outside aREPT
. - Test too-long, non-numeric, zero, and undefined
\<symbol>
. - Test invalid characters after line continuations.
- Test
ELIF
afterELSE
block. - Test invalid
OPT
values (also from the command line). - Test
PURGE
on an undefined symbol. - Test
EXPORT
on an anonymous label. - Test nested
REPT
/FOR
blocks. - Test
BANK()
of a symbol in a fixed section. - Test defining data in RAM section.
- Test impossible alignment in a fixed
SECTION UNION
. - Test impossible alignment in a fixed
SECTION FRAGMENT
. - Test
BANK()
for WRAM0 or HRAM symbols. - Test
SECTION
insideUNION
. - Test
SECTION
insideLOAD
. - Test
LOAD
insideLOAD
. - Test
UNION
outside a section. - Test
UNION
insideUNION
. - Test
NEXTU
andENDU
outsideUNION
. - Test unterminated
UNION
. - Test
ENDSECTION
outside aSECTION
, and within aUNION
orLOAD
.
Covered by #1256:
-
charmap_Delete
is an unused function. - Test
ATAN2
. - Test invalid fixed-point constant, e.g.
3.14q
. - Test integer constants that are too large.
- Test no-digit
$
and`
constants. - Test an .asm file with CR-LF newlines.
- Test macro args in string literals.
- Test the
>=
operator. - Test
/
in a macro arg that isn't part of/*
. -
macro_FreeArgs
is an unused function. - Test more than 4
STRFMT
args so it reallocates. - Test more than 2
PURGE
args so it reallocates. - Test
ASSERT FATAL
. - Test
FAIL
. - Test diff marks at the beginning of lines.
- Test unary
+
. - Test
ldi
andldd
. - Test
ld [hl], [hl]
. - Test
ld
withouta
. - Test
rst
with an invalid address. - Test modulo by zero.
- Test exponentiation by negative.
-
sect_String
is an unused function. -
sym_FindUnscopedSymbol
is an unused function. - Test
@
outside a section. - Test
REDEF EQU
with a not-yet-defined name. - Test
REDEF EQU
on a built-in symbol.
Sylvie commented
@ISSOtm Proposal to organize the tests into subdirectories. One could be for "error conditions", since so many of these uncovered cases are such. (Of course sometimes one test case will be able to cover everything, but other times an error would interfere with or halt subsequent processing.) Some existing tests could be moved into such a subdir.
Eldred Habert commented
Sure. The directory's listing is indeed huge.