basicAt: fails - or do I get it wrong?

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

basicAt: fails - or do I get it wrong?

Sebastian Nozzi-2
Hello,

is there a reason why these two tests fail?

Thanks,

Sebastian


testBasicAt
        | obj basicAtValue |
        obj := <{'hello':'amber'}>.
        basicAtValue := <obj['hello']>.
        self assert: basicAtValue equals: (obj basicAt: 'hello').

testBasicAtPut
        | a b aVal bVal |
        a := <{'hello':'amber'}>.
        b := Object new.
        b basicAt: 'hello' put: 'amber'.
        aVal := <a.hello>.
        bVal := <b.hello>.
        self assert: aVal equals: bVal.
Reply | Threaded
Open this post in threaded view
|

Re: basicAt: fails - or do I get it wrong?

Nicolas Petton
That's because obj is not an Amber object, so it doesn't understand
#basicAt:

Cheers,
Nico

On Mon, 2011-10-31 at 16:41 -0700, Sebastian Nozzi wrote:

> Hello,
>
> is there a reason why these two tests fail?
>
> Thanks,
>
> Sebastian
>
>
> testBasicAt
> | obj basicAtValue |
> obj := <{'hello':'amber'}>.
> basicAtValue := <obj['hello']>.
> self assert: basicAtValue equals: (obj basicAt: 'hello').
>
> testBasicAtPut
> | a b aVal bVal |
> a := <{'hello':'amber'}>.
> b := Object new.
> b basicAt: 'hello' put: 'amber'.
> aVal := <a.hello>.
> bVal := <b.hello>.
> self assert: aVal equals: bVal.