The Trunk: CollectionsTests-eem.251.mcz

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

The Trunk: CollectionsTests-eem.251.mcz

commits-2
Eliot Miranda uploaded a new version of CollectionsTests to project The Trunk:
http://source.squeak.org/trunk/CollectionsTests-eem.251.mcz

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

Name: CollectionsTests-eem.251
Author: eem
Time: 25 September 2015, 11:35:30.23 am
UUID: 28351c02-3f12-449e-8d40-bcae2557b843
Ancestors: CollectionsTests-ul.250

Add a test for at:ifAbsent:ifPresentPut:

=============== Diff against CollectionsTests-ul.250 ===============

Item was added:
+ ----- Method: DictionaryTest>>testAtIfPresentIfAbsentPut (in category 'basic tests') -----
+ testAtIfPresentIfAbsentPut
+ "Test at:ifPresent:ifAbsentPut:"
+ | dict present absent |
+ dict := Dictionary new.
+ present := absent := false.
+ self assert: (dict at: #foo ifPresent:[:v| present := true. v] ifAbsentPut:[absent := true. #present])
+ equals: #present.
+ self deny: present.
+ self assert: absent.
+
+ present := absent := false.
+ self assert: (dict at: #foo ifPresent:[:v| present := true. v] ifAbsentPut:[absent := true. #absent])
+ equals: #present.
+ self assert: present.
+ self deny: absent.!