The Trunk: MorphicTests-mt.72.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.72.mcz

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

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

Name: MorphicTests-mt.72
Author: mt
Time: 2 March 2021, 11:03:22.265687 am
UUID: b86bc3c1-fdde-7343-9628-073d9dd73d70
Ancestors: MorphicTests-mt.71

More tests for the new grid layout.

=============== Diff against MorphicTests-mt.71 ===============

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

Item was added:
+ ----- 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: GridLayoutTest>>test06Origin (in category 'tests') -----
+ test06Origin
+ "The grid's origin should be relative to its morph's position so that the morph can be moved around without the grid changing."
+
+ container position: 0@0.
+ container removeAllMorphs.
+ self test01Position.
+
+ container position: 10@10.
+ container removeAllMorphs.
+ self test01Position.!