'From Squeak3.7alpha of 11 September 2003 [latest update: #5707] on 28 February 2004 at 4:34:28 pm'! TestCase subclass: #SequenceableCollectionTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Tests-Collections-Sequenceable'! !SequenceableCollectionTest methodsFor: 'testing - testing' stamp: 'fbs 2/22/2004 11:40'! testBeginsWith "We can't test SequenceableCollection directly. However, we can test a sampling of its descendants." | la prefix oc | la := #(1 2 3 4 5 6). oc := OrderedCollection new. oc add: 1; add: 2; add: 3. self assert: (la beginsWith: #(1)). self assert: (la beginsWith: #(1 2)). self assert: (la beginsWith: #(1 2 3)). self assert: (la beginsWith: oc). self deny: (la beginsWith: #()). self deny: (la beginsWith: ''). self deny: (la beginsWith: OrderedCollection new). self assert: (oc beginsWith: #(1 2)). prefix := OrderedCollection new. self deny: (oc beginsWith: prefix). prefix add: 1. self assert: (oc beginsWith: prefix). prefix add: 2. self assert: (oc beginsWith: prefix). prefix add: 3. self assert: (oc beginsWith: prefix). prefix add: 4. self deny: (oc beginsWith: prefix).! ! !SequenceableCollectionTest methodsFor: 'testing - testing' stamp: 'fbs 2/22/2004 11:53'! testEndsWith "We can't test SequenceableCollection directly. However, we can test a sampling of its descendants." | la oc suffix | la := #(1 2 3 4 5 6). oc := OrderedCollection new. oc add: 4; add: 5; add: 6. self assert: (la endsWith: #(6)). self assert: (la endsWith: #(5 6)). self assert: (la endsWith: #(4 5 6)). self assert: (la endsWith: oc). self deny: (la endsWith: #()). self deny: (la endsWith: ''). suffix := OrderedCollection new. suffix add: 6. self assert: (oc endsWith: suffix). suffix addFirst: 5. self assert: (oc endsWith: suffix). suffix addFirst: 4. self assert: (oc endsWith: suffix). suffix addFirst: 3. self deny: (oc endsWith: suffix).! ! !SequenceableCollectionTest reorganize! ('testing - testing' testBeginsWith testEndsWith) !