scripts/image-fixes/20-SpTree-selection-skips.stSpTreeAdapterSingleSelectionTest>>testSelectPresenterItemSetsSelectedIndexInWidget, SpTreeAdapterSingleSelectionTest>>testUnselectPresenterItemUnselectsIndexInWidget, SpTreeTableAdapterSingleSelectionTest>>testSelectPresenterItemSetsSelectedIndexInWidget, SpTreeTableAdapterSingleSelectionTest>>testUnselectPresenterItemUnselectsIndexInWidget, SpTreeAdapterMultipleSelectionTest>>testSelectPresenterItemSetsSelectedIndexInWidget, SpTreeTableAdapterMultipleSelectionTest>>testSelectPresenterItemSetsSelectedIndexInWidgetThe 6 tests were stubs: each called "self skip" with the comment "No selectItem for the moment", or (the two multiple-selection ones) skipped because "there is no selectedIndex in trees". That is stale. SpTreePresenter and SpTreeTablePresenter (via SpAbstractTreePresenter) have selectItem: and unselectItem:, backed by SpAbstractTreeSelectionMode>>selectItem: and unselectItem:, and the test adapters have selectedPaths. The fix replaces each skip with a real test: selectItem: 20 then assert the widget's selectedPaths includes #(2), and selectItem: 20 followed by unselectItem: 20 then assert selectedPaths is empty. These are the tree equivalents of the list tests in the superclass. The multiple-selection classes only had the select test skipped; the unselect test is inherited from the superclass, which is not in this cluster. Only test methods are changed, no code under test, and the VMs behave identically.
| Test | Defect in | State | Cause |
|---|---|---|---|
SpTreeAdapterSingleSelectionTest>>testSelectPresenterItemSetsSelectedIndexInWidget |
test | repaired | self skip stub; selectItem: now exists on the tree presenter |
SpTreeAdapterSingleSelectionTest>>testUnselectPresenterItemUnselectsIndexInWidget |
test | repaired | self skip stub; unselectItem: now exists on the tree presenter |
SpTreeTableAdapterSingleSelectionTest>>testSelectPresenterItemSetsSelectedIndexInWidget |
test | repaired | self skip stub |
SpTreeTableAdapterSingleSelectionTest>>testUnselectPresenterItemUnselectsIndexInWidget |
test | repaired | self skip stub |
SpTreeAdapterMultipleSelectionTest>>testSelectPresenterItemSetsSelectedIndexInWidget |
test | repaired | self skip with the obsolete comment that trees have no selectedIndex; selectItem: with selectedPaths is the tree equivalent |
SpTreeTableAdapterMultipleSelectionTest>>testSelectPresenterItemSetsSelectedIndexInWidget |
test | repaired | same as the tree multiple-selection test |
Regression check: I ran all four owning test classes (SpTreeAdapterSingleSelectionTest, SpTreeTableAdapterSingleSelectionTest, SpTreeAdapterMultipleSelectionTest, SpTreeTableAdapterMultipleSelectionTest) on both our VM and Cog. Only test methods changed, so no other class covers them. Before the fix: 79 pass and 6 skip on each VM. With the fix: 85 pass, 0 skip, 0 fail or error on each VM. I ran the fixed image 3 times on each VM; the first run was 85/85, and the other two were 85 pass each. Method sources were read through our VM only.
Upstream note: Spec2: run the tree "selectItem:" tests instead of skipping them. In SpTreeAdapterSingleSelectionTest, SpTreeTableAdapterSingleSelectionTest, SpTreeAdapterMultipleSelectionTest and SpTreeTableAdapterMultipleSelectionTest, six tests skip themselves ("No selectItem for the moment", "no selectedIndex in trees"). SpTreePresenter and SpTreeTablePresenter now implement selectItem: and unselectItem:. The six tests now call them and check adapter selectedPaths: selectItem: 20 gives #(2) selected, and selectItem: 20 then unselectItem: 20 gives an empty selection. This is a Pharo/Spec2 change that has to be reviewed by the owner before any PR.
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 |
|---|---|---|---|---|---|
SpTreeAdapterMultipleSelectionTest>>testSelectPresenterItemSetsSelectedIndexInWidget | SKIP | repaired | PASS 2x | PASS 2x | PASS 3 of 3 (repair run) |
SpTreeAdapterSingleSelectionTest>>testSelectPresenterItemSetsSelectedIndexInWidget | SKIP | repaired | PASS 2x | PASS 2x | PASS 3 of 3 (repair run) |
SpTreeAdapterSingleSelectionTest>>testUnselectPresenterItemUnselectsIndexInWidget | SKIP | repaired | PASS 2x | PASS 2x | PASS 3 of 3 (repair run) |
SpTreeTableAdapterMultipleSelectionTest>>testSelectPresenterItemSetsSelectedIndexInWidget | SKIP | repaired | PASS 2x | PASS 2x | PASS 3 of 3 (repair run) |
SpTreeTableAdapterSingleSelectionTest>>testSelectPresenterItemSetsSelectedIndexInWidget | SKIP | repaired | PASS 2x | PASS 2x | PASS 3 of 3 (repair run) |
SpTreeTableAdapterSingleSelectionTest>>testUnselectPresenterItemUnselectsIndexInWidget | SKIP | repaired | PASS 2x | PASS 2x | 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)." ((SpTreeAdapterMultipleSelectionTest selector: #testSelectPresenterItemSetsSelectedIndexInWidget) run) printString. ((SpTreeAdapterSingleSelectionTest selector: #testSelectPresenterItemSetsSelectedIndexInWidget) run) printString. ((SpTreeAdapterSingleSelectionTest selector: #testUnselectPresenterItemUnselectsIndexInWidget) run) printString. ((SpTreeTableAdapterMultipleSelectionTest selector: #testSelectPresenterItemSetsSelectedIndexInWidget) run) printString. ((SpTreeTableAdapterSingleSelectionTest selector: #testSelectPresenterItemSetsSelectedIndexInWidget) run) printString. ((SpTreeTableAdapterSingleSelectionTest selector: #testUnselectPresenterItemUnselectsIndexInWidget) run) printString.
testSelectPresenterItemSetsSelectedIndexInWidget "There is no selectedIndex in trees (but selectedPath). This cancels superclass method" self skip
testSelectPresenterItemSetsSelectedIndexInWidget self skip. "No selectItem for the moment"
testUnselectPresenterItemUnselectsIndexInWidget self skip. "No selectItem for the moment"
testSelectPresenterItemSetsSelectedIndexInWidget "There is no selectedIndex in trees (but selectedPath). This cancels superclass method" self skip
testSelectPresenterItemSetsSelectedIndexInWidget self skip. "No selectItem for the moment"
testUnselectPresenterItemUnselectsIndexInWidget self skip. "No selectItem for the moment"
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: #SpTreeAdapterSingleSelectionTest value: #testSelectPresenterItemSetsSelectedIndexInWidget value: [ :source | source includesSubstring: 'self skip' ] value: 'testSelectPresenterItemSetsSelectedIndexInWidget presenter selectItem: 20. self assert: (self adapter selectedPaths includes: #(2))'. fix value: #SpTreeAdapterSingleSelectionTest value: #testUnselectPresenterItemUnselectsIndexInWidget value: [ :source | source includesSubstring: 'self skip' ] value: 'testUnselectPresenterItemUnselectsIndexInWidget presenter selectItem: 20; unselectItem: 20. self assert: self adapter selectedPaths isEmpty'. fix value: #SpTreeTableAdapterSingleSelectionTest value: #testSelectPresenterItemSetsSelectedIndexInWidget value: [ :source | source includesSubstring: 'self skip' ] value: 'testSelectPresenterItemSetsSelectedIndexInWidget presenter selectItem: 20. self assert: (self adapter selectedPaths includes: #(2))'. fix value: #SpTreeTableAdapterSingleSelectionTest value: #testUnselectPresenterItemUnselectsIndexInWidget value: [ :source | source includesSubstring: 'self skip' ] value: 'testUnselectPresenterItemUnselectsIndexInWidget presenter selectItem: 20; unselectItem: 20. self assert: self adapter selectedPaths isEmpty'. fix value: #SpTreeAdapterMultipleSelectionTest value: #testSelectPresenterItemSetsSelectedIndexInWidget value: [ :source | source includesSubstring: 'self skip' ] value: 'testSelectPresenterItemSetsSelectedIndexInWidget presenter selectItem: 20. self assert: (self adapter selectedPaths includes: #(2))'. fix value: #SpTreeTableAdapterMultipleSelectionTest value: #testSelectPresenterItemSetsSelectedIndexInWidget value: [ :source | source includesSubstring: 'self skip' ] value: 'testSelectPresenterItemSetsSelectedIndexInWidget presenter selectItem: 20. self assert: (self adapter selectedPaths includes: #(2))'.
State of 2026-11-20. Made from the test records of the iospharo project (a second Pharo VM). The fixes are proposals for review.