compiler/tests/extras/PPCExpressionsVerificationTest.st
changeset 502 1e45d3c96ec5
parent 464 f6d77fee9811
--- a/compiler/tests/extras/PPCExpressionsVerificationTest.st	Thu May 21 14:12:22 2015 +0100
+++ b/compiler/tests/extras/PPCExpressionsVerificationTest.st	Fri Jul 24 15:06:54 2015 +0100
@@ -75,7 +75,22 @@
     source := fileResources expressionOfSize: 100. 
     result := normalParser parse: source.
     
-    self assert: ((result deepFlatten select: [ :e | e isNumber ]) size) = 100.
-    self assert: ((result deepFlatten select: [ :e | e isNumber ]) size) = 100.
+    self assert: (((self deepFlattened: result) select: [ :e | e isNumber ]) size) = 100.
+    self assert: (((self deepFlattened: result)select: [ :e | e isNumber ]) size) = 100.
 ! !
 
+!PPCExpressionsVerificationTest methodsFor:'utilities'!
+
+deepFlatten: anObject into: aCollection
+    (anObject isCollection and:[anObject isString not]) ifTrue:[
+        anObject do:[:each|self deepFlatten: each into: aCollection]
+    ] ifFalse:[
+        aCollection add: anObject 
+    ].
+    ^aCollection
+!
+
+deepFlattened: aCollection
+    ^self deepFlatten: aCollection into: OrderedCollection new.
+! !
+