The Inbox: SUnit-ct.154.mcz

[email protected] Tue, 28 Jul 2026 21:19:24 0000
Newsgroups gmane.comp.lang.smalltalk.squeak.general
Message-ID <[email protected]>
A new version of SUnit was added to project The Inbox:
http://source.squeak.org/inbox/SUnit-ct.154.mcz

==================== Summary ====================

Name: SUnit-ct.154
Author: ct
Time: 28 July 2026, 11:19:24.757971 pm
UUID: 9e0564cc-bdd3-4cc8-a1d0-0e1f2084d6a9
Ancestors: SUnit-mt.153

Proposal: Makes expected defects, timeouts, and unexpected passes browsable from status bar of test runners (statusText must send #printText to use this). Also prepares better multilingual support.

=============== Diff against SUnit-mt.153 ===============

Item was added:
+ ----- Method: TestResult>>browseTests:label: (in category 'printing') -----
+ browseTests: tests label: label
+ 
+ 	^ self systemNavigation
+ 		browseMessageList: (tests collect: [:ea | (ea class >> ea selector) asCodeReference])
+ 		name: label!

Item was changed:
  ----- Method: TestResult>>printOn: (in category 'printing') -----
  printOn: aStream
+ 	| details |
+ 	details := aStream originalContents species streamContents: [:stream |
+ 		self flag: #asCommaString.
+ 		{('{1} pass' asPluralBasedOn: self expectedPassCount) translated format: {self expectedPassCount}.
+ 		((('{1} expected defect' asPluralBasedOn: self expectedDefectCount) translated as: aStream originalContents species) format: {self expectedDefectCount})
+ 			in: [:phrase | (self expectedDefectCount > 0 and: [phrase isText]) ifTrue: [
+ 				phrase addAttribute: (PluggableTextAttribute evalBlock: [self browseTests: self expectedDefects label: 'Expected defects' translated])]];
+ 			yourself.
+ 		('{1} failure' asPluralBasedOn: self unexpectedFailureCount) translated format: {self unexpectedFailureCount}}
+ 			do: [:ea | stream nextPutAll: ea]
+ 			separatedBy: [stream nextPutAll: ', ' translated]].
+ 	self timeouts ifNotEmpty:
+ 		[details := ('{1} ({2})' translated as: details species) format:
+ 			{details.
+ 			((('{1} timeout' asPluralBasedOn: self timeouts) translated as: details species) format: {self timeouts size})
+ 				in: [:phrase | (self timeouts notEmpty and: [phrase isText]) ifTrue: [
+ 					phrase addAttribute: (PluggableTextAttribute evalBlock: [self browseTests: self timeouts asArray label: 'Timeouts' translated])]];
+ 				yourself}].
+ 	details := details species streamContents: [:stream |
+ 		self flag: #asCommaString.
+ 		{details.
+ 		('{1} error' asPluralBasedOn: self unexpectedErrorCount) translated format: {self unexpectedErrorCount}.
+ 		((('{1} unexpected pass' asPluralBasedOn: self unexpectedPassCount) translated as: aStream originalContents species) format: {self unexpectedPassCount})
+ 			in: [:phrase | (self unexpectedPassCount > 0 and: [phrase isText]) ifTrue: [
+ 				phrase addAttribute: (PluggableTextAttribute evalBlock: [self browseTests: self unexpectedPasses label: 'Unexpected passes' translated])]];
+ 			yourself}
+ 				do: [:ea | stream nextPutAll: ea]
+ 				separatedBy: [stream nextPutAll: ', ' translated]].
+ 	
+ 	aStream nextPutAll: (('{1} run in, {2}, {3}' translated as: details species) format:
+ 		{self runCount. self duration milliSeconds. details}).!
- 	aStream
- 		nextPutAll: self runCount printString;
- 		nextPutAll: ' run in ';
- 		nextPutAll: (Duration milliSeconds: self duration) printString;
- 		nextPutAll: ', ';
- 		nextPutAll: self expectedPassCount printString;
- 		nextPutAll: (self expectedPassCount = 1 ifTrue: [' pass, '] ifFalse: [' passes, ']);
- 		nextPutAll: self expectedDefectCount printString;
- 		nextPutAll: (self expectedDefectCount = 1 ifTrue: [' expected defect, '] ifFalse: [' expected defects, ']);
- 		nextPutAll: self unexpectedFailureCount printString;
- 		nextPutAll: (self unexpectedFailureCount = 1 ifTrue: [' failure'] ifFalse: [' failures']).
- 	timeouts ifNotEmpty:
- 		[aStream
- 			nextPutAll: ' ('; print: timeouts size; 
- 			nextPutAll: (timeouts size = 1 ifTrue: [' timeout)'] ifFalse: [' timeouts)'])].
- 	aStream
- 		nextPutAll: ', ';
- 		nextPutAll: self unexpectedErrorCount printString;
- 		nextPutAll: (self unexpectedErrorCount = 1 ifTrue: [' error, '] ifFalse: [' errors, ']);
- 		nextPutAll: self unexpectedPassCount printString;
- 		nextPutAll: (self unexpectedPassCount = 1 ifTrue: [' unexpected pass'] ifFalse: [' unexpected passes']).!

Item was added:
+ ----- Method: TestResult>>printText (in category 'printing') -----
+ printText
+ 
+ 	^ Text streamContents: [:stream |
+ 		self printOn: stream]!

Item was added:
+ ----- Method: TestResult>>timeouts (in category 'compatibility') -----
+ timeouts
+ 	^ timeouts!

Squeak-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]