Add Oakwood 'In' module and a test for it.

This commit is contained in:
David Brown 2016-10-30 14:22:10 +00:00
parent 03556336ce
commit 2a242ae960
7 changed files with 151 additions and 79 deletions

View 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

View 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.

View 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