Pharo test defects

SpRadioButtonInteractionTest

State
Fixed (image fix)
Defect in
the test
Tests
2
Fix
image fix 20-SpRadioButtonInteractionTest.st
Upstream repository
pharo-spec/Spec

Record

Both tests were skipped with the remark "Composable presenters do not have adapters so this test breaks". The inherited tests from SpAbstractAdapterTest call self adapter isVisible, but the presenter under test (SpTestPresenterWithThreeRadioButtons) is a composable presenter with no adapter. hide/show on it only change its own visible state and do not reach the child widgets. The test was the defect: the author knew and skipped. The fix replaces the skip with the real check on the presenter that owns a widget: open the instance, hide (or hide then show) radio1, and assert the radio1 adapter isVisible is false (or true). I tried first to assert the composite's own children after composite hide; that failed on both VMs (Spec does not propagate visibility from a composable presenter to its children), so I did not use it. No VM difference was seen.

Test Defect in State Cause
SpRadioButtonInteractionTest>>testHidePresenterHidesWidget test repaired Test skipped itself because the tested presenter is composable and has no adapter; the inherited check of self adapter isVisible cannot work. Rewritten to hide radio1 and check its adapter.
SpRadioButtonInteractionTest>>testShowPresenterShowsWidget test repaired Same as the hide test. Rewritten to hide then show radio1 and check its adapter is visible.

Regression check: Only test methods of SpRadioButtonInteractionTest changed, so only that class was run, with and without the fix, on both VMs. Before: 9 pass, 2 skip (11 tests) on each VM. After: 11 pass, 0 other, on ours and on Cog, in 3 runs each. No non-test method was changed, so no other class was run.

Upstream note: Spec2: SpRadioButtonInteractionTest stops skipping testHidePresenterHidesWidget and testShowPresenterShowsWidget. The tested presenter is composable and has no adapter, so the tests now hide/show the radio1 presenter, which owns a widget, and check that its adapter isVisible follows. This is a test-only change. Not for Cog; for review by the owner before any PR.

Results

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.

TestBeforeStateiospharo VMPatched CogStock Cog
SpRadioButtonInteractionTest>>testHidePresenterHidesWidgetSKIPrepairedPASS 2xPASS 2xPASS 3 of 3 (repair run)
SpRadioButtonInteractionTest>>testShowPresenterShowsWidgetSKIPrepairedPASS 2xPASS 2xPASS 3 of 3 (repair run)

Test

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)."
((SpRadioButtonInteractionTest selector: #testHidePresenterHidesWidget) run) printString.
((SpRadioButtonInteractionTest selector: #testShowPresenterShowsWidget) run) printString.

Source of the tests before the fix

SpRadioButtonInteractionTest>>testHidePresenterHidesWidget before the fix (Pharo 14 build 791)
testHidePresenterHidesWidget

	"Composable presenters do not have adapters so this test breaks..."
	self skip
SpRadioButtonInteractionTest>>testShowPresenterShowsWidget before the fix (Pharo 14 build 791)
testShowPresenterShowsWidget

	"Composable presenters do not have adapters so this test breaks..."
	self skip

Fix

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.

20-SpRadioButtonInteractionTest.st (download)
"SpRadioButtonInteractionTest: the presenter under test is a composable presenter
 (SpTestPresenterWithThreeRadioButtons).  A composable presenter has no adapter and
 hide/show on it only change its own visible state; the widget is the adapter of a
 presenter in its layout.  The two tests were skipped with this very remark.  They now
 hide/show the radio button presenter, which owns the widget, and check the widget."
fix value: #SpRadioButtonInteractionTest value: #testHidePresenterHidesWidget
 value: [ :src | src includesSubstring: 'self skip' ]
 value: 'testHidePresenterHidesWidget

	"A composable presenter has no adapter: hide the radio button presenter that owns the widget."
	self openInstance.
	self presenter radio1 hide.
	self deny: self presenter radio1 adapter isVisible'.
fix value: #SpRadioButtonInteractionTest value: #testShowPresenterShowsWidget
 value: [ :src | src includesSubstring: 'self skip' ]
 value: 'testShowPresenterShowsWidget

	"A composable presenter has no adapter: show the radio button presenter that owns the widget."
	self openInstance.
	self presenter radio1 hide.
	self presenter radio1 show.
	self assert: self presenter radio1 adapter isVisible'.

State of 2026-11-20. Made from the test records of the iospharo project (a second Pharo VM). The fixes are proposals for review.