The Trunk: CollectionsTests-ar.151.mcz

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

The Trunk: CollectionsTests-ar.151.mcz

commits-2
Andreas Raab uploaded a new version of CollectionsTests to project The Trunk:
http://source.squeak.org/trunk/CollectionsTests-ar.151.mcz

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

Name: CollectionsTests-ar.151
Author: ar
Time: 4 March 2010, 8:33:57.891 pm
UUID: 3995d062-0a33-6b42-a08d-d56ed2c72396
Ancestors: CollectionsTests-ar.150

Add tests for at:ifPresent:ifAbsent: (illustrating a bug in the implementation).

=============== Diff against CollectionsTests-ar.150 ===============

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


Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: CollectionsTests-ar.151.mcz

Chris Muller-3
Ok, I will not again get so lulled into thinking these kinds of
methods are so straight-up "obviously simple."  Obviously, they're
not..

On Thu, Mar 4, 2010 at 10:34 PM,  <[hidden email]> wrote:

> Andreas Raab uploaded a new version of CollectionsTests to project The Trunk:
> http://source.squeak.org/trunk/CollectionsTests-ar.151.mcz
>
> ==================== Summary ====================
>
> Name: CollectionsTests-ar.151
> Author: ar
> Time: 4 March 2010, 8:33:57.891 pm
> UUID: 3995d062-0a33-6b42-a08d-d56ed2c72396
> Ancestors: CollectionsTests-ar.150
>
> Add tests for at:ifPresent:ifAbsent: (illustrating a bug in the implementation).
>
> =============== Diff against CollectionsTests-ar.150 ===============
>
> Item was added:
> + ----- Method: DictionaryTest>>testAtIfPresentIfAbsent (in category 'basic tests') -----
> + testAtIfPresentIfAbsent
> +       "Test at:ifPresent:ifAbsent:"
> +       | dict present absent |
> +       dict := Dictionary new.
> +       present := absent := false.
> +       dict at: #foo ifPresent:[:v| present := true] ifAbsent:[absent := true].
> +       self deny: present.
> +       self assert: absent.
> +
> +       dict at: #foo put: #bar.
> +       present := absent := false.
> +       dict at: #foo ifPresent:[:v| present := true] ifAbsent:[absent := true].
> +       self assert: present.
> +       self deny: absent.
> +
> +       present := absent := false.
> +       dict at: #foo ifPresent:[:v| present := true. nil] ifAbsent:[absent := true].
> +       self assert: present.
> +       self deny: absent.
> + !
>
>
>