mirror of
https://github.com/ProgramSnail/Lama.git
synced 2025-12-05 22:38:44 +00:00
Added test for expr + stmt
This commit is contained in:
parent
2aa460a25a
commit
7bf40bf26f
4 changed files with 41 additions and 0 deletions
|
|
@ -7,6 +7,7 @@ RC=../src/rc.opt
|
|||
check: $(TESTS)
|
||||
|
||||
$(TESTS): %: %.expr
|
||||
@echo $@
|
||||
@$(RC) $< && cat $@.input | ./$@ > $@.log && diff $@.log orig/$@.log
|
||||
@cat $@.input | $(RC) -i $< > $@.log && diff $@.log orig/$@.log
|
||||
@cat $@.input | $(RC) -s $< > $@.log && diff $@.log orig/$@.log
|
||||
|
|
|
|||
13
regression/orig/test054.log
Normal file
13
regression/orig/test054.log
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
> 105
|
||||
105
|
||||
105
|
||||
230
|
||||
105
|
||||
105
|
||||
105
|
||||
230
|
||||
105
|
||||
250
|
||||
1
|
||||
2
|
||||
3
|
||||
26
regression/test054.expr
Normal file
26
regression/test054.expr
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
x := y := z := 105;
|
||||
|
||||
n := read ();
|
||||
|
||||
write (x);
|
||||
write (y);
|
||||
write (z);
|
||||
|
||||
if z then x else y fi := 230;
|
||||
|
||||
write (x);
|
||||
write (y);
|
||||
write (z);
|
||||
|
||||
(write (z); z) := 250;
|
||||
|
||||
write (x);
|
||||
write (y);
|
||||
write (z);
|
||||
|
||||
s := [1, 2, 3, 4];
|
||||
i := -1;
|
||||
|
||||
while n := s[i := i + 1]; n == 1 !! n == 2 !! n == 3 do
|
||||
write (n)
|
||||
od
|
||||
1
regression/test054.input
Normal file
1
regression/test054.input
Normal file
|
|
@ -0,0 +1 @@
|
|||
0
|
||||
Loading…
Add table
Add a link
Reference in a new issue