X-Git-Url: https://secure.softndesign.org/git/?a=blobdiff_plain;f=calc.c;h=c31743d0193696c94db512c12ddfc04185a5e6ee;hb=a9a3da22ab3f1bf022fc02443494006bca82ed45;hp=87e24e6693fb8a1015b0c8b92027a0260ec2a765;hpb=72b7d4bcd0a74ff67e5249b9960c5b1d1ca80509;p=calc.git diff --git a/calc.c b/calc.c index 87e24e6..c31743d 100644 --- a/calc.c +++ b/calc.c @@ -384,6 +384,12 @@ int main (int argc, char *argv[]) // test: echo -e 'prog (2, 2, {rcl (2) - rcl (1)})\nprog (3, 1, cos(rcl (1) * pi / 3))\ncall (1, 2, 3)\nls\nedit (1)\ndel (1)\n\ndel (2)\ncall (2, 1, 4)' | calc.exe | grep -c error | xargs test 4 = // test: echo -e 'erf (1)\nerfc (1)\nquit' | calc.exe -v 3 | grep -q bye // test: echo -e 'erf ()\nerfc ()' | calc.exe | grep -c error | xargs test 2 = +// test: echo -e 'set (1, 2, 3, 3.11, pi, 4)\nget (4)' | calc.exe | grep '=> 3.11' +// test: echo -e 'set (1, 2, 3, 3.11, pi, 4)\npop\npop\n5\npush\nshow' | calc.exe | grep 'stack: 1 2 3 3.11 5' +// test: echo -e 'set (1, 2, 3, 3.11, pi, 4)\nset\nput (3, 4)\nshow' | calc.exe | grep 'stack: 0 0 4' +// test: echo -e 'set (1, 2, 3, 3.11, pi, 4)\nlen' | calc.exe | grep '=> 6' +// test: echo -e 'set (1, 2)\npop\npush (3)\nput (5, -1)\nlen\nshow\nget (3)\nquit' | calc.exe -n -v 3 | grep -q bye +// test: echo -e 'put\nget\nget (1)\npop\nput (0)' | calc.exe | grep -c 'error' | xargs test 5 = // Gauss sequence // test: echo -e '{sto (1, 0), sto (10, 0), while (inc (10) < 100, {sto (1, rcl (1) + rcl (10)), print (rcl (1))})};' | calc.exe | grep -q '=> 5050'