mirror of
https://github.com/vishapoberon/compiler.git
synced 2026-04-06 04:02:25 +00:00
Add Oakwood 'In' module and a test for it.
This commit is contained in:
parent
03556336ce
commit
2a242ae960
7 changed files with 151 additions and 79 deletions
14
src/test/confidence/in/expected
Normal file
14
src/test/confidence/in/expected
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
--- Testing with Oberon 2 variable model ---
|
||||
chars: Splurdle
|
||||
integer: 37
|
||||
string: "Bert"
|
||||
line: rest of line
|
||||
line: another line
|
||||
|
||||
|
||||
--- Testing with Component Pascal variable model ---
|
||||
chars: Splurdle
|
||||
integer: 37
|
||||
string: "Bert"
|
||||
line: rest of line
|
||||
line: another line
|
||||
16
src/test/confidence/in/intest.mod
Normal file
16
src/test/confidence/in/intest.mod
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
MODULE intest;
|
||||
IMPORT Out, In;
|
||||
|
||||
VAR ch: CHAR; i: INTEGER; s: ARRAY 100 OF CHAR;
|
||||
|
||||
BEGIN
|
||||
In.Char(ch); Out.String("chars: ");
|
||||
WHILE In.Done & (ch # ".") DO Out.Char(ch); In.Char(ch) END;
|
||||
Out.Ln;
|
||||
In.Int(i); IF In.Done THEN Out.String("integer: "); Out.Int(i,1); Out.Ln END;
|
||||
In.String(s); IF In.Done THEN Out.String('string: "'); Out.String(s); Out.String('"'); Out.Ln END;
|
||||
In.Line(s);
|
||||
WHILE In.Done DO
|
||||
Out.String("line: "); Out.String(s); Out.Ln; In.Line(s)
|
||||
END
|
||||
END intest.
|
||||
16
src/test/confidence/in/test.sh
Normal file
16
src/test/confidence/in/test.sh
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
#!/bin/sh
|
||||
. ../testenv.sh
|
||||
rm -f intest # Remove LSW binary so it doesn't hide Cygwin binary.
|
||||
echo 'Splurdle.25H "Bert"rest of line'>input
|
||||
echo another line>>input
|
||||
$OBECOMP intest.mod -m -O2
|
||||
./intest <input >result-O2
|
||||
$OBECOMP intest.mod -m -OC
|
||||
./intest <input >result-OC
|
||||
echo --- Testing with Oberon 2 variable model --- >result
|
||||
cat result-O2 >>result
|
||||
echo "" >>result
|
||||
echo "" >>result
|
||||
echo --- Testing with Component Pascal variable model --- >>result
|
||||
cat result-OC >>result
|
||||
. ../testresult.sh
|
||||
Loading…
Add table
Add a link
Reference in a new issue