#FEATURE
authorClaus Gittinger <cg@exept.de>
Wed, 13 Jan 2016 14:38:51 +0100
changeset 1299 c9fdd72327a5
parent 1298 4a316075f201
child 1300 3dc512cbf863
#FEATURE reindexedcollection tests
RegressionTests__CollectionTests.st
--- a/RegressionTests__CollectionTests.st	Fri Jan 08 15:24:31 2016 +0100
+++ b/RegressionTests__CollectionTests.st	Wed Jan 13 14:38:51 2016 +0100
@@ -971,6 +971,37 @@
     "
 ! !
 
+!CollectionTests methodsFor:'tests-reindexedCollection'!
+
+testReindexedCollection01
+    |s c c2|
+
+    s := OrderedCollection new.
+    s addAll:#('one' 'two' 'three' 'four' 'five').
+
+    c := s from:2.
+    
+    self assert: ( c size == (s size - 1) ).
+    1 to:c size do:[:i |
+        self assert: ( (c at:i) == (s at:i+1) ).
+    ].
+    
+    c2 := c collect:[:el |el].
+    self assert:(c2 size == c size).
+    self assert:(c2 = c).
+
+    c2 := c select:[:el |true].
+    self assert:(c2 size == c size).
+    self assert:(c2 = c).
+    
+    c2 := c select:[:el | el startsWith:'t'].
+    self assert:(c2 size == (s count:[:el | el startsWith:'t' ])).
+
+    "
+     self basicNew testReindexedCollection01
+    "
+! !
+
 !CollectionTests methodsFor:'tests-replace'!
 
 testEmptyReplace