--- a/RegressionTests__CECollectionExtensionTest.st Fri Jul 07 11:17:22 2017 +0200
+++ b/RegressionTests__CECollectionExtensionTest.st Tue Jul 11 19:49:54 2017 +0200
@@ -37,25 +37,25 @@
testCollectAsSet
"self debug: #testCollectAsSet"
-
+
self assert: ((#() collectAsSet: [:each | each odd]) = Set new).
self assert: (#(1 2 3 4 5 6) collectAsSet: [:each | each odd])
= (Set with: true with: false).
- self assert: (#(1 3 5 7 9 11) collectAsSet: [:each | each odd])
+ self assert: (#(1 3 5 7 9 11) collectAsSet: [:each | each odd])
= (Set with: true).
-
+
self assert: (#(1 2 3 4 5 4 3 2 1) collectAsSet: [:each | each]) = (1 to: 5) asSet.
-
-
+
+
!
testCollectAsSetUsingSymbol
"self debug: #testCollectAsSetUsingSymbol"
-
+
self assert: ((#() collectAsSet: #odd) = Set new).
self assert: (#(1 2 3 4 5 6) collectAsSet: #odd)
= (Set with: true with: false).
- self assert: (#(1 3 5 7 9 11) collectAsSet: #odd)
+ self assert: (#(1 3 5 7 9 11) collectAsSet: #odd)
= (Set with: true).
! !
@@ -63,36 +63,36 @@
testFlatCollect
"self debug: #testFlatCollect"
-
-
+
+
!
testFlatCollectArray
"self debug: #testFlatCollectArray"
-
+
self assert: ((#((1 2) (3 4) (5 3)) flatCollect: [ :each | each ]) = #(1 2 3 4 5 3)).
- self assert: ((#((1 2) (2 3) (1 3 4)) flatCollect: [:each | each]) = #(1 2 2 3 1 3 4)).
-
- self assert: ((#((1 2) (2 3) () ()) flatCollect: [:each | each]) = #(1 2 2 3)).
+ self assert: ((#((1 2) (2 3) (1 3 4)) flatCollect: [:each | each]) = #(1 2 2 3 1 3 4)).
+
+ self assert: ((#((1 2) (2 3) () ()) flatCollect: [:each | each]) = #(1 2 2 3)).
self assert: ((#((1 2) (2 3) (1 3 4)) flatCollect: [:each| Array with: each])
= #(#(1 2) #(2 3) #(1 3 4))).
-
+
self assert: ((#((1 2) (2 3) (1 3 4)) flatCollect: [:each| Set with: each])
- = #(#(1 2) #(2 3) #(1 3 4))).
-
+ = #(#(1 2) #(2 3) #(1 3 4))).
+
!
testFlatCollectSet
"self debug: #testFlatCollectSet"
-
+
self assert: ((#((1 2) (1 2) (1 3 4)) asSet flatCollect: [:each | each]) = #(1 1 2 3 4) asSet).
- self assert: ((#() asSet flatCollect: [:each]) = #() asSet).
+ self assert: ((#((1)) asSet flatCollect: [:each | each]) = #() asSet).
self assert: ((#((1 2) () (1 3 4)) asSet flatCollect: [:each | each]) = #(1 1 2 3 4) asSet).
- self assert: ((#((1 2) #((99)) (1 3 4)) asSet flatCollect: [:each | each])
+ self assert: ((#((1 2) #((99)) (1 3 4)) asSet flatCollect: [:each | each])
= #(1 1 2 3 4 (99)) asSet).
- self assert: ((#((1 2) #(()) (1 3 4)) asSet flatCollect: [:each | each])
+ self assert: ((#((1 2) #(()) (1 3 4)) asSet flatCollect: [:each | each])
= #(1 1 2 3 4 ()) asSet).
! !
@@ -144,9 +144,9 @@
testGroupedBy
"self debug: #testGroupedBy"
-
+
| res |
- res := #(1 2 3 4 5) asOrderedCollection
+ res := #(1 2 3 4 5) asOrderedCollection
groupedBy: [:each | each odd].
self assert: (res at: true) = #(1 3 5) asOrderedCollection.
self assert: (res at: false) = #(2 4) asOrderedCollection
@@ -154,7 +154,7 @@
testGroupedByArray
"self debug: #testGroupedByArray"
-
+
| res |
res := #(1 2 3 4 5) groupedBy: [:each | each odd].
self assert: (res at: true) = #(1 3 5).
@@ -163,7 +163,7 @@
testGroupedBySet
"self debug: #testGroupedBySet"
-
+
| res |
res := #(1 2 3 4 5 3 4 5) asSet groupedBy: [:each | each odd].
self assert: (res at: true) = #(1 3 5) asSet.
@@ -174,7 +174,7 @@
testSymbolInPlaceOfBlock
"self debug: #testSymbolInPlaceOfBlock"
-
+
self assert: (#(1 2 3 4) collect: #odd) = #(true false true false).
self assert: (#(1 2 3 4) select: #odd) = #(1 3).
! !
@@ -188,4 +188,3 @@
version_CVS
^ '$Header$'
! !
-