adding test system

This commit is contained in:
Yann Esposito (Yogsototh) 2013-07-17 22:25:48 +02:00
parent d12ffc4f58
commit 7e377e2a32
11 changed files with 27 additions and 0 deletions

17
test.sh Executable file
View file

@ -0,0 +1,17 @@
#!/usr/bin/env zsh
for fic in tests/*.in; do
input="${fic:r}"
arg="$(cat $input.in)"
print -n -- "$input: "
runghc y.hs "$arg" > $input.res
if diff $input.res $input.out > /dev/null; then
print -- "OK"
else
print -- "ERROR"
print -- " expected: '$(cat $input.out)'"
print -- " got: '$(cat $input.res)'"
print -- ""
fi
\rm -f $input.res
done

1
tests/binarynumber.in Normal file
View file

@ -0,0 +1 @@
#b001010

1
tests/binarynumber.out Normal file
View file

@ -0,0 +1 @@
Number 10

1
tests/number.in Normal file
View file

@ -0,0 +1 @@
32

1
tests/number.out Normal file
View file

@ -0,0 +1 @@
Number 32

1
tests/string-2.in Normal file
View file

@ -0,0 +1 @@
"This is a string with a return ->\n<- Here"

1
tests/string-2.out Normal file
View file

@ -0,0 +1 @@
String "This is a string with a return ->\n<- Here"

1
tests/string-3.in Normal file
View file

@ -0,0 +1 @@
"This is a string with a tab ->\t<- Here"

1
tests/string-3.out Normal file
View file

@ -0,0 +1 @@
String "This is a string with a tab ->\t<- Here"

1
tests/string.in Normal file
View file

@ -0,0 +1 @@
"This is a simple string"

1
tests/string.out Normal file
View file

@ -0,0 +1 @@
String "This is a simple string"