1.2 KiB
1.2 KiB
STATUS — eval phase
Commit: f083f901cdfdf6ba6614a95171506efd917b31a4
Gate Results
D1 — arithmetic (precedence, parens, unary minus)
- Command:
python calc.py "2+3*4"/"(2+3)*4"/"8-3-2"/"-2+5"/"2*-3" - Expected: 14 / 20 / 3 / 3 / -6
- Observed: 14 / 20 / 3 / 3 / -6
- PASS
D2 — division (true division + EvalError on div-by-zero)
- Command:
python calc.py "7/2"→ 3.5;python calc.py "1/0"→ stderr + exit 1 - Expected: 3.5; error: division by zero, exit 1
- Observed: 3.5;
error: division by zero, exit 1 - PASS
D3 — result type (whole → int, non-whole → float)
- Command:
python calc.py "4/2"→2;python calc.py "7/2"→3.5 - Expected:
2(no.0);3.5 - Observed:
2;3.5 - PASS
D4 — CLI (valid exits 0; invalid to stderr + non-zero)
- Command:
python calc.py "2+3*4"→14, exit 0;python calc.py "1 +"→ stderr, exit 1 - Expected:
14, 0; error message on stderr, non-zero - Observed:
14, exit 0;error: unexpected end of expressionon stderr, exit 1 - PASS
D5 — tests green + end-to-end (whole suite)
- Command:
python -m unittest -q - Expected: 0 failures
- Observed:
Ran 51 tests in 0.065s/OK - PASS