Pharo test defects

Package: MicroUML (olekscode/MicroUML, row 110)

State
Fixed (package repair)
Defect in
see the record
Tests
0
Fix
olekscode-microuml.st
Upstream repository
olekscode/MicroUML

The record is the text of the repair. The Results table is the last run of the row.

Record

Test

Load the package into a Pharo 14 image (build 791) with the load expression of the test run, file in the fixes file of the row if there is one, and run the test classes of the package.

"row 110"
Metacello new baseline: 'MicroUML'; repository: 'github://olekscode/MicroUML:main/src'; onConflict: [:e | e useIncoming]; load: #('default' 'MicroUML-Tests').

Results

Last result of the package run (stock Cog and iospharo on the same image).

RowLabelLoadStock Cogiospharo VM
110olekscode-microumloktests=83 P=83 F=0 E=0 S=0 T=0 X=0tests=83 P=83 F=0 E=0 S=0 T=0 X=0

Fix

Fixes file (filed in after the load): olekscode-microuml.st (download)
"olekscode/MicroUML: MicroUMLCodeGeneratorTest>>setUp named the dummy package
'__MicroUML__Dummy-Package__'.  Pharo 14 PackageOrganizer>>addPackage: refuses a
package name whose first character is not an uppercase letter ('Package names
should be uppercase'), and '_' is not uppercase.  The four tests that make the
package (testGenerateClassInPackageNamed, testGenerateClassSideVariables,
testGenerateClassesInPackageNamed, testGenerateInstanceVariables) failed with
that error.  The repair starts the name with an uppercase letter and keeps the
rest, so the name stays unlikely to exist already.

testIsReadyToGenerateClass failed with 'Denial failed' as a consequence: the
failed tests had already made classes such as Object__ and Animal__ in
Smalltalk globals, and tearDown only removes the package, which did not exist.
The classes stayed, so isReadyToGenerateClass: answered true for Animal__ where
the test denies it.  With a valid package name, tearDown removes the package
together with the classes, and the test starts from a clean system.  No entry
is needed for that test."

fix value: #MicroUMLCodeGeneratorTest value: #setUp
	value: [ :source | source includesSubstring: '''__MicroUML__Dummy-Package__''' ]
	value:
'setUp

	super setUp.
	
	uml := self exampleUML.
	generator := MicroUMLCodeGenerator forDiagram: uml diagram.
	
	"We add __ to decrease the chance that a package with this names already exists.  Pharo 14 requires that a package name starts with an uppercase letter."
	packageName := ''Z_MicroUML__Dummy-Package__'''.

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