remove needless library module imports in unit tests

This commit is contained in:
Irmen de Jong
2025-10-05 13:09:37 +02:00
parent 961095bfec
commit 4195e3968a
10 changed files with 77 additions and 104 deletions

View File

@@ -413,8 +413,6 @@ main {
test("various array indexed assignment scenarios") {
val src="""
%import floats
%import textio
%zeropage basicsafe
main {
bool[10] barray
@@ -456,14 +454,10 @@ main {
dump()
sub dump() {
txt.print_bool(barray[2])
txt.spc()
txt.print_uw(warrayns[2])
txt.spc()
txt.print_uw(warray[2])
txt.spc()
txt.print_f(farray[2])
txt.nl()
bool @shared bb = barray[2]
uword @shared ww = warrayns[2]
uword @shared ww2 = warray[2]
float @shared ff = farray[2]
}
}
}"""

View File

@@ -197,8 +197,6 @@ main {
"identifiers can have the names of cpu instructions" {
val text="""
%import textio
nop {
sub lda(ubyte sec) -> ubyte {
asl:
@@ -223,13 +221,15 @@ main {
sub start() {
ubyte col = 10
ubyte row = 20
txt.print_ub(nop.lda(42))
txt.nl()
txt.print_uw(nop.lda.asl)
print_ub(nop.lda(42))
print_uw(nop.lda.asl)
void ffalse(99)
void ftrue(99)
}
sub print_ub(ubyte v) {}
sub print_uw(uword v) {}
}
"""
val result = compileText(C64Target(), false, text, outputDir, writeAssembly = true)

View File

@@ -19,14 +19,11 @@ class TestLibrary: FunSpec({
val outputDir = tempdir().toPath()
test("library compilation (x16)") {
val src="""
%address ${'$'}A050
%memtop ${'$'}C000
val src= $$"""
%address $A050
%memtop $C000
%output library
%import textio
main {
; Create a jump table as first thing in the library.
uword[] @shared @nosplit jumptable = [
@@ -105,23 +102,20 @@ library {
}
test("library compilation (c64)") {
val src="""
%address ${'$'}8050
%memtop ${'$'}a000
val src= $$"""
%address $8050
%memtop $a000
%output library
%import textio
main {
; Create a jump table as first thing in the library.
uword[] @shared @nosplit jumptable = [
; NOTE: the compiler has inserted a single JMP instruction at the start of the 'main' block, that jumps to the start() routine.
; This is convenient because the rest of the jump table simply follows it,
; making the first jump neatly be the required initialization routine for the library (initializing variables and BSS region).
; btw, ${'$'}4c = opcode for JMP.
${'$'}4c00, &library.func1,
${'$'}4c00, &library.func2,
; btw, $4c = opcode for JMP.
$4c00, &library.func1,
$4c00, &library.func2,
]
sub start() {