From: Laurent Mazet Date: Tue, 24 Jan 2023 13:53:06 +0000 (+0100) Subject: correct some tests X-Git-Tag: v0.8~25 X-Git-Url: https://secure.softndesign.org/git/?a=commitdiff_plain;h=7e98ca87314d0c63713c3afd4e833c5a3a93798e;p=calc.git correct some tests --- diff --git a/calc.c b/calc.c index 02d0d98..611e155 100644 --- 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: */