Marcel Taeumel uploaded a new version of MorphicTests to project The Trunk: http://source.squeak.org/trunk/MorphicTests-mt.73.mcz
==================== Summary ====================
Name: MorphicTests-mt.73 Author: mt Time: 4 March 2021, 9:04:20.359869 am UUID: 51b5fae1-e96f-9045-9bc9-2a7561c0cacb Ancestors: MorphicTests-mt.72
Adds test for owner-changed handler, which is a simple layout hook that does not require a layout policy.
Fixes a name in a grid-layout test.
=============== Diff against MorphicTests-mt.72 ===============
Item was added: + ----- Method: GridLayoutTest>>test05AdhereToEdge (in category 'tests') ----- + test05AdhereToEdge + "The grid should be ignored for morphs that snap to their owner's edges." + + | m | + m := Morph new color: Color random; extent: 10@10; yourself. + container addMorph: m. + + "1) Manual adhere-to-edge will not work." + m position: 0@(100 - 10). + container fullBounds. + self assert: 0@100 equals: m position. + + "2) Use adhere-to-edge property." + m setToAdhereToEdge: #bottom. + container fullBounds. + self assert: 0@(100 - 10) equals: m position.!
Item was removed: - ----- Method: GridLayoutTest>>test05SnapToEdge (in category 'tests') ----- - test05SnapToEdge - "The grid should be ignored for morphs that snap to their owner's edges." - - | m | - m := Morph new color: Color random; extent: 10@10; yourself. - container addMorph: m. - - "1) Manual snap-to-edge will not work." - m position: 0@(100 - 10). - container fullBounds. - self assert: 0@100 equals: m position. - - "2) Use snap-to-edge property." - m setToAdhereToEdge: #bottom. - container fullBounds. - self assert: 0@(100 - 10) equals: m position.!
Item was added: + ----- Method: MorphLayoutTest>>makeYellow: (in category 'helper') ----- + makeYellow: aMorph + + aMorph color: Color yellow.!
Item was added: + ----- Method: MorphLayoutTest>>testOwnerChangedHandler (in category 'tests') ----- + testOwnerChangedHandler + + | m1 m2 | + m1 := Morph new extent: 100@100; yourself. + m2 := Morph new extent: 10@10; yourself. + + m1 addMorph: m2. + self ensureLayout: m1. + self assert: 10@10 equals: m2 extent. + + m2 ownerChangedHandler: [:m | m extent: m owner extent]. + self ensureLayout: m1. + self assert: 100@100 equals: m2 extent. + + m2 color: Color red. + m2 ownerChangedHandler: (MessageSend receiver: self selector: #makeYellow:). + self assert: Color red equals: m2 color. + self ensureLayout: m1. + self assert: Color yellow equals: m2 color. + + m2 ownerChangedHandler: #delete. + self assert: m1 hasSubmorphs. + self ensureLayout: m1. + self deny: m1 hasSubmorphs.!
packages@lists.squeakfoundation.org