[squeak-dev] The Trunk: GraphicsTests-nice.53.mcz

commits at source.squeak.org commits at source.squeak.org
Thu May 16 18:16:38 UTC 2019


Nicolas Cellier uploaded a new version of GraphicsTests to project The Trunk:
http://source.squeak.org/trunk/GraphicsTests-nice.53.mcz

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

Name: GraphicsTests-nice.53
Author: nice
Time: 16 May 2019, 8:15:16.075297 pm
UUID: 3f05f59a-6940-4d79-ad13-3724ac086821
Ancestors: GraphicsTests-nice.52

Add tests for round trip conversion of Color fromString: printHtmlString.

=============== Diff against GraphicsTests-nice.52 ===============

Item was changed:
  ----- Method: ColorTest>>testPrintHtmlString (in category 'tests') -----
  testPrintHtmlString
  	"self debug: #testPrintHtmlString"
  	
+ 	"test the semantic of components"
  	self assert: Color white printHtmlString = 'FFFFFF'.
  	self assert: Color red printHtmlString =  'FF0000'.
+ 	self assert: Color green printHtmlString =  '00FF00'.
+ 	self assert: Color blue printHtmlString =  '0000FF'.
+ 	self assert: Color black printHtmlString = '000000'.
+ 	
+ 	"test all possible values for each component (but no combinatorial)"
+ 	16r00 to: 16rFF do:
+ 		[:component |
+ 		| xx o roo ogo oob |
+ 		xx := component printStringBase: 16 length: 2 padded: true.
+ 		o := '00'.
+ 		roo := xx , o , o.
+ 		ogo := o , xx , o.
+ 		oob := o , o , xx.
+ 		self assert: roo equals: (Color fromString: '#' , roo) printHtmlString.
+ 		self assert: ogo equals: (Color fromString: '#' , ogo) printHtmlString.
+ 		self assert: oob equals: (Color fromString: '#' , oob) printHtmlString].!
- 	self assert: Color black printHtmlString = '000000'.!



More information about the Squeak-dev mailing list