The Trunk: MorphicTests-mt.69.mcz

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

The Trunk: MorphicTests-mt.69.mcz

commits-2
Marcel Taeumel uploaded a new version of MorphicTests to project The Trunk:
http://source.squeak.org/trunk/MorphicTests-mt.69.mcz

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

Name: MorphicTests-mt.69
Author: mt
Time: 20 February 2021, 12:47:37.056759 pm
UUID: 9a34f942-2d5d-8649-9d6f-30697a22ca90
Ancestors: MorphicTests-mt.68

Complements Morphic-mt.1724

=============== Diff against MorphicTests-mt.68 ===============

Item was added:
+ TestCase subclass: #GridLayoutTest
+ instanceVariableNames: 'container'
+ classVariableNames: ''
+ poolDictionaries: ''
+ category: 'MorphicTests-Layouts'!

Item was added:
+ ----- Method: GridLayoutTest>>addMorph (in category 'support') -----
+ addMorph
+
+ | newMorph |
+ newMorph := Morph new
+ position: 0@0; extent: 10@10;
+ hResizing: #spaceFill; vResizing: #spaceFill;
+ color: Color random;
+ yourself.
+ container addMorph: newMorph.
+ ^ newMorph!

Item was added:
+ ----- Method: GridLayoutTest>>setUp (in category 'running') -----
+ setUp
+
+ super setUp.
+ container := Morph new
+ color: Color random;
+ position: 0@0;
+ extent: 100@100;
+ layoutPolicy: GridLayout new;
+ gridOrigin: 0@0;
+ gridModulus: 20@20;
+ yourself.!

Item was added:
+ ----- Method: GridLayoutTest>>test01Position (in category 'tests') -----
+ test01Position
+
+ | m |
+ m := self addMorph.
+ {
+ 0@0 . 0@0 .
+ 9@9 . 0@0 .
+ 10@10 . 20@20 .
+ 25@25 . 20@20
+ } pairsDo: [:newPosition :expectedGrid |
+ m position: newPosition.
+ container fullBounds.
+ self assert: expectedGrid equals: m position].!

Item was added:
+ ----- Method: GridLayoutTest>>test02Extent (in category 'tests') -----
+ test02Extent
+
+ | m |
+ m := self addMorph.
+ {
+ 20@20 . 20@20 .
+ 50@50 . 60@60 .
+ 49@49 . 40@40 .
+ } pairsDo: [:newExtent :expectedGrid |
+ m extent: newExtent.
+ container fullBounds.
+ self assert: expectedGrid equals: m extent].!

Item was added:
+ ----- Method: GridLayoutTest>>test03ExtentRigid (in category 'tests') -----
+ test03ExtentRigid
+ "The morph's extent will not be changed to match the grid cells when its resizing strategy is #rigid."
+
+ | m |
+ m := self addMorph.
+ m hResizing: #rigid; vResizing: #rigid.
+ {
+ 20@20 . 20@20 .
+ 50@50 . 50@50 .
+ 49@49 . 49@49 .
+ 0@0 . 0@0
+ } pairsDo: [:newExtent :expectedGrid |
+ m extent: newExtent.
+ container fullBounds.
+ self assert: expectedGrid equals: m extent].!

Item was added:
+ ----- Method: GridLayoutTest>>test04ExtentMinimum (in category 'tests') -----
+ test04ExtentMinimum
+
+ | m |
+ m := self addMorph.
+ m extent: 0@0.
+ container fullBounds.
+ self assert: container gridModulus equals: m extent.!