[squeak-dev] The Inbox: CollectionsTests-topa.185.mcz

Levente Uzonyi leves at elte.hu
Tue May 24 16:35:19 UTC 2011


On Tue, 24 May 2011, Tobias Pape wrote:

>
> Am 2011-05-23 um 13:56 schrieb Tobias Pape:
>
>> Am 2011-05-23 um 11:50 schrieb commits at source.squeak.org:
>>
>>> A new version of CollectionsTests was added to project The Inbox:
>>> http://source.squeak.org/inbox/CollectionsTests-topa.185.mcz
>>>
>>> ==================== Summary ====================
>>>
>>> Name: CollectionsTests-topa.185
>>> Author: topa
>>> Time: 23 May 2011, 1:50:29.396 pm
>>> UUID: 8e536e32-1fb9-4bdd-8d4b-3088b46e41a9
>>> Ancestors: CollectionsTests-nice.184
>>>
>>> Mall testcase for RWBinaryOrTextStream on exisiting
>>> collections.
>>>
>>> =============== Diff against CollectionsTests-nice.184 ===============
>>>
>>> Item was added:
>>> + ----- Method: RWBinaryOrTextStreamTest>>testExisiting (in category 'tests') -----
>>> + testExisiting
>>> +
>>> + 	| string stream |
>>> +
>>> + 	string := 'hello'.
>>> +
>>> + 	stream := RWBinaryOrTextStream on: string.
>>> + 	self assert: stream contents = string.
>
> Btw: is that actually the right pattern for readWrite streams
> with pre-filled content?
> or should I do things like that in another way?

Your assumption looks right. I'd expect

ReadWriteStream on: aString

to behave just like

ReadWriteStream on: aString from: 1 to: aString size


Levente

>
>>> +
>>> + 	stream := RWBinaryOrTextStream on: string.
>>> + 	stream setToEnd.
>>> + 	self assert: stream position = string size.
>>> + !
>
> Best
> 	-Tobias
>
>
>



More information about the Squeak-dev mailing list