Reactos

[CMD_ROSTEST] Add tests for SET /A errorlevels.

+85
+56
modules/rostests/win32/cmd/test_builtins.cmd
··· 498 498 :continue 499 499 500 500 501 + :: Testing different ERRORLEVELs from the SET command. 502 + :: See https://ss64.com/nt/set.html for more details. 503 + 504 + echo ---------- Testing SET /A ERRORLEVELs ---------- 505 + 506 + echo --- Success 507 + call :setError 0 508 + set /a "total=1+1" 509 + call :checkErrorLevel 0 510 + echo %errorlevel% 511 + echo %total% 512 + 513 + echo --- Unbalanced parentheses 514 + call :setError 0 515 + set /a "total=(2+1" 516 + call :checkErrorLevel 1073750988 517 + echo %errorlevel% 518 + echo %total% 519 + 520 + echo --- Missing operand 521 + call :setError 0 522 + set /a "total=5*" 523 + call :checkErrorLevel 1073750989 524 + echo %errorlevel% 525 + echo %total% 526 + 527 + echo --- Syntax error 528 + call :setError 0 529 + set /a "total=7$3" 530 + call :checkErrorLevel 1073750990 531 + echo %errorlevel% 532 + echo %total% 533 + 534 + echo --- Invalid number 535 + call :setError 0 536 + set /a "total=0xdeadbeeg" 537 + call :checkErrorLevel 1073750991 538 + echo %errorlevel% 539 + echo %total% 540 + 541 + echo --- Number larger than 32-bits 542 + call :setError 0 543 + set /a "total=999999999999999999999999" 544 + call :checkErrorLevel 1073750992 545 + echo %errorlevel% 546 + echo %total% 547 + 548 + echo --- Division by zero 549 + call :setError 0 550 + set /a "total=1/0" 551 + call :checkErrorLevel 1073750993 552 + echo %errorlevel% 553 + echo %total% 554 + 555 + 556 + 501 557 :: 502 558 :: Finished! 503 559 ::
+29
modules/rostests/win32/cmd/test_builtins.cmd.exp
··· 130 130 0 131 131 0 132 132 0 133 + ---------- Testing SET /A ERRORLEVELs ---------- 134 + --- Success 135 + OK 136 + 0 137 + 2 138 + --- Unbalanced parentheses 139 + OK 140 + 1073750988 141 + 2 142 + --- Missing operand 143 + OK 144 + 1073750989 145 + 2 146 + --- Syntax error 147 + OK 148 + 1073750990 149 + 7 150 + --- Invalid number 151 + OK 152 + 1073750991 153 + 7 154 + --- Number larger than 32-bits 155 + OK 156 + 1073750992 157 + 7 158 + --- Division by zero 159 + OK 160 + 1073750993 161 + 7 133 162 --------- Finished --------------