Moved "Shell" code into a "Glob" type/namespace, and removed FormatSpecification...
[cslatevm.git] / tests / mapoverlay.slate
blobaf3c617cb899a0cc7b4c09eeae67e76416ae3e85
1 UnitTests addPrototype: #MapOverlay derivedFrom: { TestCase }.
3 "Tests the MapOverlay class"
5 t@(UnitTests MapOverlay traits) setUp
7   t addSlot: #d1 valued: Dictionary new
8    `>> [ add: 'one' -> 'Uno'. add: 'two' -> 'dos'. ].
9   t addSlot: #d2 valued: Dictionary new
10     `>> [ add: 'two' -> 'Dos'. add: 'three' -> 'Tres'. ].
12   t addSlot: #mapOverlay valued: (t d1 overlayWith: t d2).
15 t@(UnitTests MapOverlay traits) testAccess
17   t assert: ((t mapOverlay at: 'one') = 'Uno').
18   t assert: ((t mapOverlay at: 'two') = 'Dos').
19   t assert: ((t mapOverlay at: 'three') = 'Tres').
20   t should: [t mapOverlay at: 'four'] raise: MapOverlay KeyNotFound.
23 t@(UnitTests MapOverlay traits) testAddition
25   t mapOverlay add: 'five' -> 'Cinco'.
26   t assert: ((t mapOverlay at: 'five') = 'Cinco').
27   t assert: ((t d2 at: 'five') = 'Cinco').
28   t should: [t d1 at: 'five'] raise: MapOverlay KeyNotFound.
31 t@(UnitTests MapOverlay traits) suite
32 [t suiteForSelectors: {
33   #testAccess.
34   #testAddition.
35 }].