From 58b04ba77c4f9f0789856eb2f1512be3cf2fdbd0 Mon Sep 17 00:00:00 2001 From: marcobaye Date: Sun, 18 Feb 2024 13:50:32 +0000 Subject: [PATCH] more test files git-svn-id: https://svn.code.sf.net/p/acme-crossass/code-0/trunk@342 4df02467-bbd4-4a76-a152-e7ce94205b78 --- testing/auto/iterables.a | 22 +++++++++++ testing/auto/postfix.a | 36 ++++++++++++++++++ testing/cliargs/Makefile | 2 +- testing/cliargs/outformat-apple.exp | Bin 0 -> 7 bytes testing/cliargs/outformat-apple.o | Bin 7 -> 0 bytes testing/cliargs/outformat-cbm.exp | Bin 0 -> 5 bytes testing/cliargs/outformat-cbm.o | Bin 5 -> 0 bytes testing/cliargs/outformat-plain.exp | Bin 0 -> 3 bytes testing/cliargs/outformat-plain.o | 1 - testing/cliargs/outformats.a | 2 +- testing/cliargs/outformats.sh | 22 +++++------ testing/cpus/Makefile | 8 ++-- .../cpus/{expected-4502.o => out-4502.exp} | Bin .../cpus/{expected-6502.o => out-6502.exp} | Bin .../cpus/{expected-65816.o => out-65816.exp} | Bin .../cpus/{expected-65c02.o => out-65c02.exp} | Bin .../{expected-65ce02.o => out-65ce02.exp} | Bin .../{expected-c64dtv2.o => out-c64dtv2.exp} | Bin testing/cpus/{expected-m65.o => out-m65.exp} | Bin .../{expected-nmos6502.o => out-nmos6502.exp} | Bin .../{expected-r65c02.o => out-r65c02.exp} | Bin .../{expected-w65c02.o => out-w65c02.exp} | Bin testing/errors/stringlength1.a | 2 + testing/errors/stringlength2.a | 2 + 24 files changed, 79 insertions(+), 18 deletions(-) create mode 100644 testing/auto/iterables.a create mode 100644 testing/auto/postfix.a create mode 100644 testing/cliargs/outformat-apple.exp delete mode 100644 testing/cliargs/outformat-apple.o create mode 100644 testing/cliargs/outformat-cbm.exp delete mode 100644 testing/cliargs/outformat-cbm.o create mode 100644 testing/cliargs/outformat-plain.exp delete mode 100644 testing/cliargs/outformat-plain.o rename testing/cpus/{expected-4502.o => out-4502.exp} (100%) rename testing/cpus/{expected-6502.o => out-6502.exp} (100%) rename testing/cpus/{expected-65816.o => out-65816.exp} (100%) rename testing/cpus/{expected-65c02.o => out-65c02.exp} (100%) rename testing/cpus/{expected-65ce02.o => out-65ce02.exp} (100%) rename testing/cpus/{expected-c64dtv2.o => out-c64dtv2.exp} (100%) rename testing/cpus/{expected-m65.o => out-m65.exp} (100%) rename testing/cpus/{expected-nmos6502.o => out-nmos6502.exp} (100%) rename testing/cpus/{expected-r65c02.o => out-r65c02.exp} (100%) rename testing/cpus/{expected-w65c02.o => out-w65c02.exp} (100%) create mode 100644 testing/errors/stringlength1.a create mode 100644 testing/errors/stringlength2.a diff --git a/testing/auto/iterables.a b/testing/auto/iterables.a new file mode 100644 index 0000000..119d5ae --- /dev/null +++ b/testing/auto/iterables.a @@ -0,0 +1,22 @@ + + !macro a @r { + !if @r != 1 { + !error "assertion failed" + } + } + + squares = [1, 4, 9] + emptylist = [] + primes = [2, 3, 5, 7] + +a primes + emptylist + squares == [2,3,5,7,1,4,9] + + somestring = "Arthur" + emptystring = "" + otherstring = "Ford" + +a otherstring + emptystring + somestring == "FordArthur" + + collection = [] + !for c in "Trillian" { + !set collection = collection + [c] + } + +a collection == [84, 114, 105, 108, 108, 105, 97, 110] diff --git a/testing/auto/postfix.a b/testing/auto/postfix.a new file mode 100644 index 0000000..17dd228 --- /dev/null +++ b/testing/auto/postfix.a @@ -0,0 +1,36 @@ + !macro a @r { + !if @r != 1 { + !error "postfix did not work" + } + } + *=$1000 + a = 3 + a+2 = 3 ; symbol has not been read, so adding postfix should work +label +label+2 ; label has not been read, so adding postfix should work + !set b+2 = 17 +label2 + lda b + +a * - label2 == 3 +label3 + !for c+2, 17, 17 { + lda c + } + +a * - label3 == 3 + d+2 = 17 + !set d+2 = 17 +label4 + lda d + +a * - label4 == 3 +label5 + e+2=5 + !for e+2, 17, 17 { + lda e + } + +a * - label5 == 3 +label6 + f+3 = 17 + !for g+2, f, f { + lda g + } + +a * - label6 == 3 diff --git a/testing/cliargs/Makefile b/testing/cliargs/Makefile index 553d5fa..c149590 100644 --- a/testing/cliargs/Makefile +++ b/testing/cliargs/Makefile @@ -9,6 +9,6 @@ all: outformats echo "Testing cliargs: PASSED" echo -outformats: outformats.a outformats.sh outformat-*.o +outformats: outformats.a outformats.sh outformat-*.exp echo "Testing output formats:" bash outformats.sh diff --git a/testing/cliargs/outformat-apple.exp b/testing/cliargs/outformat-apple.exp new file mode 100644 index 0000000000000000000000000000000000000000..e497438dc943a883a99bfa2babcaeef5b2e725dd GIT binary patch literal 7 OcmZP&U}jj!kN^Mz(E%L* literal 0 HcmV?d00001 diff --git a/testing/cliargs/outformat-apple.o b/testing/cliargs/outformat-apple.o deleted file mode 100644 index 5a440472134854d616ee0d5e2accd880283ffb91..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7 OcmZP&U}jj!m;e9*(*Yg; diff --git a/testing/cliargs/outformat-cbm.exp b/testing/cliargs/outformat-cbm.exp new file mode 100644 index 0000000000000000000000000000000000000000..2343f8cd6b72f64e4dcd4af74e8225987b1a0420 GIT binary patch literal 5 McmZP&Sjmt800N)^8UO$Q literal 0 HcmV?d00001 diff --git a/testing/cliargs/outformat-cbm.o b/testing/cliargs/outformat-cbm.o deleted file mode 100644 index 7ea98306fbc665ac5abcb2931ddb39e52100153b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5 McmZP&Sjm_G00N=`8vp "String length is not 1." diff --git a/testing/errors/stringlength2.a b/testing/errors/stringlength2.a new file mode 100644 index 0000000..e2ad23f --- /dev/null +++ b/testing/errors/stringlength2.a @@ -0,0 +1,2 @@ + *=$1000 + lda #"aa" ; -> "String length is not 1."