[squeak-dev] The Trunk: CollectionsTests-ar.151.mcz

Chris Muller asqueaker at gmail.com
Fri Mar 5 17:38:37 UTC 2010


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,  <commits at source.squeak.org> 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.
> + !
>
>
>



More information about the Squeak-dev mailing list