The Trunk: CollectionsTests-dtl.213.mcz

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

The Trunk: CollectionsTests-dtl.213.mcz

commits-2
Levente Uzonyi uploaded a new version of CollectionsTests to project The Trunk:
http://source.squeak.org/trunk/CollectionsTests-dtl.213.mcz

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

Name: CollectionsTests-dtl.213
Author: dtl
Time: 19 January 2014, 2:00:26.702 pm
UUID: 92e880a5-19ae-4168-a858-3ec4520c12b2
Ancestors: CollectionsTests-dtl.212

Move testStreamContentsPositioning to WriteStreamTest

=============== Diff against CollectionsTests-dtl.212 ===============

Item was removed:
- ----- Method: OrderedCollectionTest>>testStreamContentsPositioning (in category 'testStreaming') -----
- testStreamContentsPositioning
- "String class>>new:streamContents: optimizes performance by answering the
- originalCollection in the case of a stream positioned to the size of the original
- collection. This fails if the stream has been repositioned backwards to its original
- length."
-
- "(OrderedCollectionTest selector: #testStreamContentsPositioning) debug"
-
- | s |
- s := String new: 10 streamContents: [ :strm |
- strm nextPutAll: 'XXXXX'.
- self assert: 'XXXXX' equals: strm contents.
- strm nextPut: $X.
- self assert: 'XXXXXX' equals: strm contents.
- strm position: strm position - 1.
- self assert: 'XXXXX' equals: strm contents.
- strm nextPutAll: 'XXXXX'.
- self assert: 'XXXXXXXXXX' equals: strm contents.
- strm nextPut: $X.
- self assert: 'XXXXXXXXXXX' equals: strm contents.
- strm position: strm position - 1.
- self assert: 'XXXXXXXXXX' equals: strm contents.
- ].
- self assert: 10 equals: s size.
- self assert: 'XXXXXXXXXX' equals: s.
-
- !

Item was added:
+ ----- Method: WriteStreamTest>>testStreamContentsPositioning (in category 'tests - positioning') -----
+ testStreamContentsPositioning
+ "String class>>new:streamContents: optimizes performance by answering the
+ originalCollection in the case of a stream positioned to the size of the original
+ collection. This fails if the stream has been repositioned backwards to its original
+ length."
+
+ "(OrderedCollectionTest selector: #testStreamContentsPositioning) debug"
+
+ | s |
+ s := String new: 10 streamContents: [ :strm |
+ strm nextPutAll: 'XXXXX'.
+ self assert: 'XXXXX' equals: strm contents.
+ strm nextPut: $X.
+ self assert: 'XXXXXX' equals: strm contents.
+ strm position: strm position - 1.
+ self assert: 'XXXXX' equals: strm contents.
+ strm nextPutAll: 'XXXXX'.
+ self assert: 'XXXXXXXXXX' equals: strm contents.
+ strm nextPut: $X.
+ self assert: 'XXXXXXXXXXX' equals: strm contents.
+ strm position: strm position - 1.
+ self assert: 'XXXXXXXXXX' equals: strm contents.
+ ].
+ self assert: 10 equals: s size.
+ self assert: 'XXXXXXXXXX' equals: s.
+
+ !