Nicolas Cellier uploaded a new version of CollectionsTests to project The Trunk:
http://source.squeak.org/trunk/CollectionsTests-nice.123.mcz==================== Summary ====================
Name: CollectionsTests-nice.123
Author: nice
Time: 9 December 2009, 1:07:15 am
UUID: 4755d9d1-95d6-684b-9cbc-418063d767aa
Ancestors: CollectionsTests-nice.122
Test for ReadStream on:from:to: and upToAll: with partial match
=============== Diff against CollectionsTests-nice.122 ===============
Item was added:
+ ----- Method: ReadStreamTest>>testUpToAll2 (in category 'tests - accessing') -----
+ testUpToAll2
+ | string stream array |
+ string := 'aababcabcd'.
+ stream := self streamOn: string.
+ self assert: (stream upToAll: 'a') = ''.
+ self assert: (stream upToEnd) = 'ababcabcd'.
+ stream := self streamOn: string.
+ self assert: (stream upToAll: 'ab') = 'a'.
+ self assert: (stream upToEnd) = 'abcabcd'.
+ stream := self streamOn: string.
+ self assert: (stream upToAll: 'abc') = 'aab'.
+ self assert: (stream upToEnd) = 'abcd'.
+ stream := self streamOn: string.
+ self assert: (stream upToAll: 'abcd') = 'aababc'.
+ self assert: (stream upToEnd) = ''.
+ stream := self streamOn: string.
+ self assert: (stream upToAll: 'abe') = 'aababcabcd'.
+ self assert: (stream upToEnd) = ''.
+
+ array := #(1 1 2 1 2 3 nil 1 2 3 4).
+ stream := self streamOn: array.
+ self assert: (stream upToAll: #(1)) = #().
+ self assert: (stream upToEnd) = #(1 2 1 2 3 nil 1 2 3 4).
+ stream := self streamOn: array.
+ self assert: (stream upToAll: #(1 2)) = #(1).
+ self assert: (stream upToEnd) = #(1 2 3 nil 1 2 3 4).
+ stream := self streamOn: array.
+ self assert: (stream upToAll: #(1 2 3)) = #(1 1 2).
+ self assert: (stream upToEnd) = #(nil 1 2 3 4).
+ stream := self streamOn: array.
+ self assert: (stream upToAll: #(1 2 3 4)) = #(1 1 2 1 2 3 nil).
+ self assert: (stream upToEnd) = #().
+ stream := self streamOn: array.
+ self assert: (stream upToAll: #(1 2 5)) = array.
+ self assert: (stream upToEnd) = #().!
Item was added:
+ ----- Method: ReadStreamTest>>testUpTo3 (in category 'tests - accessing') -----
+ testUpTo3
+ | stream string |
+ string := 'XYZabcdUVW'.
+ stream := ReadStream on: string from: (string indexOf: $a) to: (string indexOf: $d).
+ self assert: stream upToEnd = 'abcd'.
+ self assert: stream atEnd.
+ stream := ReadStream on: string from: (string indexOf: $a) to: (string indexOf: $d).
+ self assert: (stream upTo: $c) = 'ab'.
+ self assert: stream next = $d.
+ stream := ReadStream on: string from: (string indexOf: $a) to: (string indexOf: $d).
+ self assert: (stream upTo: $e) = 'abcd'.
+ self assert: stream atEnd.!