Tests in interpretation

This commit is contained in:
Dmitry Boulytchev 2018-04-03 07:21:59 +03:00
parent b4f6f48e30
commit 44b8a96e34
9 changed files with 89 additions and 53 deletions

View file

@ -1,4 +1,4 @@
TESTS=test001 test002 test003 test004 test005 test006 test007 test008 test009 test010 test011 test012 test013 test014 test015 test016 test017 test018 test019 test020 test021 test022 test023 test024 test025 test026 test027 test028 test029
TESTS=test001 test002 test003 test004 test005 test006 test007 test008 test009 test010 test011 test012 test013 test014 test015 test016 test017 test018 test019 test020 test021 test022 test023 test024 test025 test026 test027 test028 test029 test030 test031
RC=../src/rc.opt
@ -9,7 +9,7 @@ check: $(TESTS)
$(TESTS): %: %.expr
# @$(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
# @cat $@.input | $(RC) -s $< > $@.log && diff $@.log orig/$@.log
clean:
rm -f test*.log *.s *~ $(TESTS)

View file

@ -1,9 +1,18 @@
> > > > > > > > > > > > > > > > > > > > > > 1
2
3
> 9
55
8
34
7
21
6
13
5
8
4
5
6
7
8
9
3
3
2
2
1
1

View file

@ -1,12 +1,14 @@
> > > > > > > 6
5
4
3
2
1
1
2
3
4
5
> 7
5040
6
720
5
120
4
24
3
6
2
2
1
1

14
regression/test030.expr Normal file
View file

@ -0,0 +1,14 @@
fun fib (n) {
if n <= 1
then return 1
else
return fib (n-1) + fib (n-2)
fi
}
read (n);
for i := n, i >= 1, i := i-1 do
write (i);
write (fib (i))
od

1
regression/test030.input Normal file
View file

@ -0,0 +1 @@
9

14
regression/test031.expr Normal file
View file

@ -0,0 +1,14 @@
fun fact (n) {
if n <= 1
then return 1
else
return n * fact (n-1)
fi
}
read (n);
for i := n, i >= 1, i := i-1 do
write (i);
write (fact (i))
od

1
regression/test031.input Normal file
View file

@ -0,0 +1 @@
7