[squeak-dev] Testing JSON in Squeak 5.1beta : 1 failure
Fabio Niephaus
lists at fniephaus.com
Wed Aug 17 17:21:51 UTC 2016
On Wed, Aug 17, 2016 at 7:14 PM Fabio Niephaus <lists at fniephaus.com> wrote:
>
> --
>
> On Wed, Aug 17, 2016 at 6:54 PM H. Hirzel <hannes.hirzel at gmail.com> wrote:
>
>> testing JSON (Squeak 5.1beta-16510)
>>
>> MCHttpRepository
>> location: 'http://www.squeaksource.com/JSON'
>> user: ''
>> password: ''
>>
>> Version:
>>
>> Name: JSON-tonyg.37
>> Author: tonyg
>> Time: 29 April 2016, 11:47:17.129 am
>> UUID: 63e50a8f-d436-4128-952c-3c0c8c12e120
>>
>>
>> 16 out of 17 tests pass, 1 failure in
>>
>> testStreaming
>> | j |
>> j := Json new stream: 'truefalsetrue[]{}1.234
>> 5.678"A""B"nullnull' readStream.
>> self assert: j readAny equals: true.
>> self assert: j readAny equals: false.
>> self assert: j readAny equals: true.
>> self assert: j readAny equals: #().
>> self assert: j readAny equals: Dictionary new. "<<<<<<<
>> FAILURE HERE "
>>
>
> I'm not sure if it's a good idea to test if this equals a new dictionary
> here.
> Changing the line like this makes the test pass:
>
> self assert: j readAny isDictionary.
>
> `j readAny` returns a JsonObject which directly inherits from Dictionary.
>
> Best,
> Fabio
>
Turns out Dictionary>>= has changed and compares "species" now.
>
>
>
>> self assert: j readAny equals: 1.234.
>> self assert: j readAny equals: 5.678.
>> self assert: j readAny equals: 'A'.
>> self assert: j readAny equals: 'B'.
>> self assert: j readAny equals: nil.
>> self assert: j readAny equals: nil.
>>
>> --Hannes
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20160817/c1add84d/attachment.htm
More information about the Squeak-dev
mailing list
|