[squeak-dev] The Trunk: GraphicsTests-mt.57.mcz

commits at source.squeak.org commits at source.squeak.org
Tue Apr 13 15:30:11 UTC 2021


Marcel Taeumel uploaded a new version of GraphicsTests to project The Trunk:
http://source.squeak.org/trunk/GraphicsTests-mt.57.mcz

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

Name: GraphicsTests-mt.57
Author: mt
Time: 13 April 2021, 5:30:10.904381 pm
UUID: c9be18bf-f4b0-4345-bb55-e3f3a0133d56
Ancestors: GraphicsTests-ct.56

Adds tests for #pointAtFraction: and #randomPoint.

=============== Diff against GraphicsTests-ct.56 ===============

Item was added:
+ ----- Method: RectangleTest>>testPointAtFraction (in category 'tests') -----
+ testPointAtFraction
+ 	
+ 	| r |
+ 	r := Rectangle origin: 0 at 0 extent: 50 at 50.
+ 	
+ 	{
+ 		r topLeft . 0.0 @ 0.0 .
+ 		r center . 0.5 @ 0.5 .
+ 		r bottomRight . 1.0 @ 1.0 .
+ 		
+ 		5 at 5 . 0.1 @ 0.1 .
+ 		40 at 50 . 0.8 @ 1.0
+ 	
+ 	} groupsDo: [ :expected :fraction |
+ 		self assert: expected equals: (r pointAtFraction: fraction)].!

Item was added:
+ ----- Method: RectangleTest>>testPointAtFractionExact (in category 'tests') -----
+ testPointAtFractionExact
+ 	
+ 	| r |
+ 	r := Rectangle origin: 0.2 at 0.2 corner: 1.0 at 1.0.
+ 	
+ 	{
+ 		r topLeft . 0.0 @ 0.0 .
+ 		"r center . 0.5 @ 0.5 . --- Not yet working."
+ 		r bottomRight . 1.0 @ 1.0 .
+ 		
+ 		0.6 @ 0.6 . 0.5 @ 0.5 .
+ 	
+ 	} groupsDo: [ :expected :fraction |
+ 		self assert: (expected closeTo: (r pointAtFraction: fraction))].!

Item was added:
+ ----- Method: RectangleTest>>testRandomPoint (in category 'tests') -----
+ testRandomPoint
+ 	
+ 	| r |
+ 	r := Rectangle origin: 0 at 0 extent: 50 at 50.
+ 	self assert: (r containsPoint: r randomPoint).
+ 	self assert: r randomPoint isIntegerPoint.!

Item was added:
+ ----- Method: RectangleTest>>testRandomPointExact (in category 'tests') -----
+ testRandomPointExact
+ 	
+ 	| r |
+ 	r := Rectangle origin: 0.2 at 0.2 corner: 1.0 at 1.0.
+ 	self assert: (r containsPoint: r randomPoint).
+ 	self deny: r randomPoint isIntegerPoint.!



More information about the Squeak-dev mailing list