RegressionTests__PowerSetTests.st
author Claus Gittinger <cg@exept.de>
Thu, 14 Apr 2016 19:08:20 +0200
changeset 1393 50384f233a0f
parent 1075 6c94d6335387
child 1447 2351db93aa5b
child 1499 26a16a04219b
permissions -rw-r--r--
#DOCUMENTATION by cg class: RegressionTests::Win32OLETests changed: #test00_loadOLE

"{ Package: 'exept:regression' }"

"{ NameSpace: RegressionTests }"

TestCase subclass:#PowerSetTests
	instanceVariableNames:''
	classVariableNames:''
	poolDictionaries:''
	category:'tests-Regression-Collections'
!


!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 asSet).     
    ].

    "
     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$'
! !