mirror of
https://github.com/usatiuk/psil.git
synced 2025-10-28 18:57:48 +01:00
repl test
This commit is contained in:
9
clitests/replexample.testi.psil
Normal file
9
clitests/replexample.testi.psil
Normal file
@@ -0,0 +1,9 @@
|
||||
(+ 2 3)
|
||||
(if (= testin (read)) ok bad)
|
||||
testin
|
||||
(eval (read))
|
||||
(+ 4 5)
|
||||
(define (equal a b)(if (nil? a) (if (nil? b) 1 0)(if (atom a)(if (atom b) (= a b) 0)(if (atom b) 0 (if (equal (car a) (car b)) (equal (cdr a) (cdr b)) 0)))))
|
||||
(if (equal (quote(a b)) (read)) ok bad)
|
||||
(a b)
|
||||
(quit)
|
||||
5
clitests/replexample.testi.psil.ex
Normal file
5
clitests/replexample.testi.psil.ex
Normal file
@@ -0,0 +1,5 @@
|
||||
> 5
|
||||
> ok
|
||||
> 9
|
||||
> > ok
|
||||
>
|
||||
@@ -22,6 +22,25 @@ for FILE in *.test.psil; do
|
||||
rm $FILE.res
|
||||
done
|
||||
|
||||
for FILE in *.testi.psil; do
|
||||
echo "TESTING INTERACTIVE $FILE"
|
||||
$PSIL --repl+ --default_log_level:0 < $FILE > $FILE.res
|
||||
if [ $? -ne 0 ]; then
|
||||
FAILED+=("test-"$FILE)
|
||||
continue
|
||||
fi
|
||||
|
||||
diff -w $FILE.res $FILE.ex
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
FAILED+=("test-"$FILE)
|
||||
continue
|
||||
fi
|
||||
|
||||
echo "$FILE OK"
|
||||
rm $FILE.res
|
||||
done
|
||||
|
||||
if [ ${#FAILED[@]} -eq 0 ]; then
|
||||
echo "ALL TESTS PASSED"
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user