correct some tests
authorLaurent Mazet <laurent.mazet@thalesgroup.com>
Tue, 24 Jan 2023 13:53:06 +0000 (14:53 +0100)
committerLaurent Mazet <laurent.mazet@thalesgroup.com>
Tue, 24 Jan 2023 13:53:06 +0000 (14:53 +0100)
calc.c

diff --git a/calc.c b/calc.c
index 02d0d9803ad91e1df4474be7ca5951faf47d097a..611e1550be12d901a5d7d0b88acac1eedae8dbab 100644 (file)
--- a/calc.c
+++ b/calc.c
@@ -283,11 +283,13 @@ int main (int argc, char *argv[])
 // test: echo -e 'cos (quit)' | calc.exe 2>&1 | grep -q error
 // test: echo -e '(quit)' | calc.exe 2>&1 | grep -q error
 // test: echo -e 'cos 3.14\n!\n! 3 4' | calc.exe 2>&1 | grep -c error | xargs test 3 =
-// test: echo -e 'sto (2, pi)\ncond (rcl (2) > 2, log (64), exp (75))' | calc.exe  | grep -q '=> 4\.15888'
+// test: echo -e 'sto (2, 3)\ncond (rcl (2) > 2, log (64), exp (75 / 10))' | calc.exe  | grep -q '=> 4\.15888'
 // test: echo -e 'sto (2, 1)\ncond (rcl (2) > 2, log (64), exp (75 / 10))' | calc.exe  | grep -q '=> 1808\.04'
+// test: echo -e 'sto (2, 1)\ncond (rcl (2) > 2, log (64))' | calc.exe  | grep -q '=> 0'
 // test: echo -e 'cond (0, 1, 2)' | calc.exe -v 3 | grep -q Cond
 // test: echo -e 'cond\ncond (\ncond (1 >0,'| calc.exe 2>&1 | grep -c error | xargs test 3 =
-// test: echo -e 'sto (1, 4)\ninc (1)\ninc (1)\nrcl (1) == 6' | calc.exe -v 3 | grep -q '=> 1'
-// test: echo -e 'inc\ninc (\ndec\ndec ('| calc.exe 2>&1 | grep -c error | xargs test 4 =
+// test: echo -e 'sto (1, 4)\ninc (1)\ninc (1)\ndec (1)\ninc (1)\nrcl (1) == 6' | calc.exe -v 3 | grep -q '=> 1'
+// test: echo -e 'inc\ninc (\ndec\ndec (' | calc.exe 2>&1 | grep -c error | xargs test 4 =
+// test: echo -e 'inc (11)\ndec (0)' | calc.exe 2>&1 | grep -c invalid | xargs test 2 =
 
 /* vim: set ts=4 sw=4 et: */