complete test converage
authorLaurent Mazet <laurent.mazet@thalesgroup.com>
Tue, 31 Jan 2023 12:59:06 +0000 (13:59 +0100)
committerLaurent Mazet <laurent.mazet@thalesgroup.com>
Tue, 31 Jan 2023 12:59:06 +0000 (13:59 +0100)
calc.c

diff --git a/calc.c b/calc.c
index d73e8210b5f6707bdce938b453e498f77e1cd48c..e20b066dcd3b4538204f8feebfe22a9b01e06f88 100644 (file)
--- a/calc.c
+++ b/calc.c
@@ -376,7 +376,9 @@ int main (int argc, char *argv[])
 // test: echo -e 'dec (2)\ndisp' | calc.exe | grep -q "storage: 0 -1 0 0 0 0 0 0 0 0"
 // test: echo -e 'sto (3, pi)\nclr\ndisp' | calc.exe | grep -q "storage: 0 0 0 0 0 0 0 0 0 0"
 // test: echo -e 'mem (3)\nclr' | calc.exe -v 3 | grep -q Clear
-// test: echo -e 'prog (2, 2, {rcl (2) - rcl (1)})\nprog (1, 1, {cos (rcl (1)^2)})\ncall (1, pi/6)\nls' | calc.exe
+// test: echo -e 'prog (2, 2, {rcl (2) - rcl (1)})\nprog (1, 1, {cos (rcl (1)^2)})\ncall (1, pi/6)\nprog (2, 1, {rcl (1) * 3})\ncall (2, 1, 2)\nls' | calc.exe
+// test: echo -e 'prog (1, 2, {rcl (2) - rcl (1)})\ncall (1, 2, 3)\nls\nedit (1)\ndel (1)\nls' | calc.exe -v 3 |grep -q Program
+// test: echo -e 'prog (2, 2, {rcl (2) - rcl (1)})\ncall (1, 2, 3)\nls\nedit (1)\ndel (1)\nls' | calc.exe | grep -c error | xargs test 1 =
 
 // 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'