adding test system
This commit is contained in:
parent
d12ffc4f58
commit
7e377e2a32
11 changed files with 27 additions and 0 deletions
17
test.sh
Executable file
17
test.sh
Executable 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
1
tests/binarynumber.in
Normal file
|
@ -0,0 +1 @@
|
|||
#b001010
|
1
tests/binarynumber.out
Normal file
1
tests/binarynumber.out
Normal file
|
@ -0,0 +1 @@
|
|||
Number 10
|
1
tests/number.in
Normal file
1
tests/number.in
Normal file
|
@ -0,0 +1 @@
|
|||
32
|
1
tests/number.out
Normal file
1
tests/number.out
Normal file
|
@ -0,0 +1 @@
|
|||
Number 32
|
1
tests/string-2.in
Normal file
1
tests/string-2.in
Normal file
|
@ -0,0 +1 @@
|
|||
"This is a string with a return ->\n<- Here"
|
1
tests/string-2.out
Normal file
1
tests/string-2.out
Normal file
|
@ -0,0 +1 @@
|
|||
String "This is a string with a return ->\n<- Here"
|
1
tests/string-3.in
Normal file
1
tests/string-3.in
Normal file
|
@ -0,0 +1 @@
|
|||
"This is a string with a tab ->\t<- Here"
|
1
tests/string-3.out
Normal file
1
tests/string-3.out
Normal file
|
@ -0,0 +1 @@
|
|||
String "This is a string with a tab ->\t<- Here"
|
1
tests/string.in
Normal file
1
tests/string.in
Normal file
|
@ -0,0 +1 @@
|
|||
"This is a simple string"
|
1
tests/string.out
Normal file
1
tests/string.out
Normal file
|
@ -0,0 +1 @@
|
|||
String "This is a simple string"
|
Loading…
Reference in a new issue