scripts/image-fixes/20-OCParserTest.stOCParserTest>>testUnclosedTemporariesErrorNodeContainsRightValue, OCParserTest>>testParseExpressionDontFreezeBoth tests were defects in the test methods. testUnclosedTemporariesErrorNodeContainsRightValue started with an unconditional self skip ("extra space on the server but not locally"); with the skip removed, the assertions pass on both VMs. testParseExpressionDontFreeze was marked expectedFailure and had no assertion; it called parseExpression: '#', which raises OCCodeError ("Literal Array, ByteArray or Symbol expected"). That is the graceful error the comment says is wanted, and the test failed on it. The fix removes the skip and the mark, and the test now asserts that OCCodeError is raised. The change is a changed expectation, not a deleted check: the raise was the whole intent of the test.
| Test | Defect in | State | Cause |
|---|---|---|---|
OCParserTest>>testUnclosedTemporariesErrorNodeContainsRightValue |
test | repaired | Unconditional self skip left in the test; the underlying assertions already hold on both VMs. |
OCParserTest>>testParseExpressionDontFreeze |
test | repaired | Test is marked expectedFailure and only calls parseExpression: '#', which raises OCCodeError by design. The raise is the graceful behaviour the test comment asks for. Fix: drop the mark and assert should:raise: OCCodeError. |
Regression check: I ran OCParserTest on the base image (before) and on the fixed image (after), on our VM (ours) and on Cog. OCParserTest: 147 pass before and 149 pass after on both VMs, and the 2 changed tests are the only difference. OCPatternParserTest: 8 before, 8 after, on both VMs. OCErrorNodeParserTest: 29 before, 29 after, on both VMs. No non-test method was changed. The OCPatternParserTest and OCErrorNodeParserTest counts did not change, so I did not check whether those two classes run the inherited tests.
Upstream note: Pharo, AST-Core-Tests: OCParserTest. Remove the unconditional self skip from testUnclosedTemporariesErrorNodeContainsRightValue; the test passes. Turn testParseExpressionDontFreeze from an expectedFailure test with no assertion into a test that asserts parseExpression: '#' raises OCCodeError. The test comment says the error is the graceful result, so the expectedFailure mark was wrong.
Last full sweeps of 2026-11-17: iospharo (sweep14-new14) and stock Cog with the Cog changes (sweepcogp14-new10), with all image fixes. "Before" is the state of the test before the repairs. The Stock Cog column has a value only where the record measured stock Cog: "PASS 3 of 3 (repair run)" is the check of each repair on stock Cog v12.0.6 with the fix entry; "-" is not measured separately.
| Test | Before | State | iospharo VM | Patched Cog | Stock Cog |
|---|---|---|---|---|---|
OCParserTest>>testParseExpressionDontFreeze | XFAIL | repaired | PASS | PASS | PASS 3 of 3 (repair run) |
OCParserTest>>testUnclosedTemporariesErrorNodeContainsRightValue | SKIP | repaired | PASS | PASS | PASS 3 of 3 (repair run) |
Run the tests in a Pharo 14 image (build 791). Before the fix they skip, fail or carry the expected-failure mark.
"Run in a Playground of a Pharo 14 image (Do it and print each line)." ((OCParserTest selector: #testParseExpressionDontFreeze) run) printString. ((OCParserTest selector: #testUnclosedTemporariesErrorNodeContainsRightValue) run) printString.
testParseExpressionDontFreeze "This test is here to chark that CI does not freeze or crash on code error." "The test sould just 'fail' gracefully." <expectedFailure> "Force a parse error (from a simple tool class). The image (and CI) should not freeze :)" self parserClass parseExpression: '#'
testUnclosedTemporariesErrorNodeContainsRightValue | tree | self skip. "This test has an extra space on the server but not locally." tree := self parseFaultyExpression: '| faulty temporaries'. self assert: tree isEnglobingError. self assert: tree formattedCode equals: '| faulty temporaries |', String cr
How to apply an entries file: file in 00-header.st and the entries file as one chunk (the iospharo script scripts/gen-image-fixes.py makes that chunk). Each entry checks for the defect first and prints FIXED, ADDED or SKIP. Download 00-header.st.
fix value: #OCParserTest value: #testUnclosedTemporariesErrorNodeContainsRightValue value: [ :s | s includesSubstring: 'self skip' ] value: 'testUnclosedTemporariesErrorNodeContainsRightValue | tree | tree := self parseFaultyExpression: ''| faulty temporaries''. self assert: tree isEnglobingError. self assert: tree formattedCode equals: ''| faulty temporaries |'', String cr'. fix value: #OCParserTest value: #testParseExpressionDontFreeze value: [ :s | s includesSubstring: '<expectedFailure>' ] value: 'testParseExpressionDontFreeze "This test checks that the image (and CI) does not freeze or crash on a code error. The parse error must be reported gracefully, as an OCCodeError." self should: [ self parserClass parseExpression: ''#'' ] raise: OCCodeError'.
State of 2026-11-20. Made from the test records of the iospharo project (a second Pharo VM). The fixes are proposals for review.