RegressionTests__PowerSetTests.st
changeset 1447 2351db93aa5b
parent 1075 6c94d6335387
child 1500 d406a10b2965
equal deleted inserted replaced
1446:c3b09cef9f87 1447:2351db93aa5b
     1 "{ Package: 'exept:regression' }"
     1 "{ Package: 'stx:goodies/regression' }"
     2 
     2 
     3 "{ NameSpace: RegressionTests }"
     3 "{ NameSpace: RegressionTests }"
     4 
     4 
     5 TestCase subclass:#PowerSetTests
     5 TestCase subclass:#PowerSetTests
     6 	instanceVariableNames:''
     6 	instanceVariableNames:''
    22 
    22 
    23     self assert:(p notEmpty).
    23     self assert:(p notEmpty).
    24     self assert:(p size = 8).     "/ [] [1] [2] [3] [1 2] [1 3] [2 3] [1 2 3]
    24     self assert:(p size = 8).     "/ [] [1] [2] [3] [1 2] [1 3] [2 3] [1 2 3]
    25 
    25 
    26     #(
    26     #(
    27         #()
    27 	#()
    28         #(1)
    28 	#(1)
    29         #(2)
    29 	#(2)
    30         #(3)
    30 	#(3)
    31         #(1 2)
    31 	#(1 2)
    32         #(1 3)
    32 	#(1 3)
    33         #(2 3)
    33 	#(2 3)
    34         #(1 2 3)
    34 	#(1 2 3)
    35     ) do:[:eachExpectedElement |
    35     ) do:[:eachExpectedElement |
    36         self assert:(p includes: eachExpectedElement asSet).     
    36 	self assert:(p includes: eachExpectedElement asSet).
    37     ].
    37     ].
    38 
    38 
    39     "
    39     "
    40      self new test01
    40      self new test01
    41     "
    41     "
    45     |p|
    45     |p|
    46 
    46 
    47     p := PowerSet for:(1 to:1000).
    47     p := PowerSet for:(1 to:1000).
    48 
    48 
    49     self assert:(p notEmpty).
    49     self assert:(p notEmpty).
    50     self assert:(p size = (2 raisedTo:1000)).     
    50     self assert:(p size = (2 raisedTo:1000)).
    51 
    51 
    52     "
    52     "
    53      self new test02
    53      self new test02
    54     "
    54     "
    55 ! !
    55 ! !