initial checkin
authorClaus Gittinger <cg@exept.de>
Mon, 20 Mar 2006 09:44:28 +0100
changeset 323 15e4ba3cae0a
parent 322 22f981fbf932
child 324 cf40af91120c
initial checkin
RegressionTests__PowerSetTests.st
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/RegressionTests__PowerSetTests.st	Mon Mar 20 09:44:28 2006 +0100
@@ -0,0 +1,61 @@
+"{ Package: 'exept:regression' }"
+
+"{ NameSpace: RegressionTests }"
+
+TestCase subclass:#PowerSetTests
+	instanceVariableNames:''
+	classVariableNames:''
+	poolDictionaries:''
+	category:'tests-Regression'
+!
+
+
+!PowerSetTests methodsFor:'testing'!
+
+test01
+    |s p|
+
+    s := #(1 2 3) asSet.
+    p := PowerSet for:s.
+
+    p do:[:subSet | Transcript showCR:subSet].
+
+    self assert:(p notEmpty).
+    self assert:(p size = 8).     "/ [] [1] [2] [3] [1 2] [1 3] [2 3] [1 2 3]
+
+    #(
+        #()
+        #(1)
+        #(2)
+        #(3)
+        #(1 2)
+        #(1 3)
+        #(2 3)
+        #(1 2 3)
+    ) do:[:eachExpectedElement |
+        self assert:(p includes: eachExpectedElement).     
+    ].
+
+    "
+     self new test01
+    "
+!
+
+test02
+    |p|
+
+    p := PowerSet for:(1 to:1000).
+
+    self assert:(p notEmpty).
+    self assert:(p size = (2 raisedTo:1000)).     
+
+    "
+     self new test02
+    "
+! !
+
+!PowerSetTests class methodsFor:'documentation'!
+
+version
+    ^ '$Header$'
+! !