[squeak-dev] The Trunk: MorphicTests-mt.69.mcz

commits at source.squeak.org commits at source.squeak.org
Sat Feb 20 11:47:37 UTC 2021


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 at 0; extent: 10 at 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 at 0;
+ 		extent: 100 at 100;
+ 		layoutPolicy: GridLayout new;
+ 		gridOrigin: 0 at 0;
+ 		gridModulus: 20 at 20;
+ 		yourself.!

Item was added:
+ ----- Method: GridLayoutTest>>test01Position (in category 'tests') -----
+ test01Position
+ 
+ 	| m |
+ 	m := self addMorph.
+ 	{
+ 		0 at 0 . 0 at 0 .
+ 		9 at 9 . 0 at 0 .
+ 		10 at 10 . 20 at 20 .
+ 		25 at 25 . 20 at 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 at 20 . 20 at 20 .
+ 		50 at 50 . 60 at 60 .
+ 		49 at 49 . 40 at 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 at 20 . 20 at 20 .
+ 		50 at 50 . 50 at 50 .
+ 		49 at 49 . 49 at 49 .
+ 		0 at 0 . 0 at 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 at 0.
+ 	container fullBounds.
+ 	self assert: container gridModulus equals: m extent.!



More information about the Squeak-dev mailing list