The Trunk: GraphicsTests-mt.57.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: GraphicsTests-mt.57.mcz

commits-2
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@0 extent: 50@50.
+
+ {
+ r topLeft . 0.0 @ 0.0 .
+ r center . 0.5 @ 0.5 .
+ r bottomRight . 1.0 @ 1.0 .
+
+ 5@5 . 0.1 @ 0.1 .
+ 40@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@0.2 corner: 1.0@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@0 extent: 50@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@0.2 corner: 1.0@1.0.
+ self assert: (r containsPoint: r randomPoint).
+ self deny: r randomPoint isIntegerPoint.!