예제 #1
0
 /**
  * This method tests the boxing of a value.
  *
  * @dataProvider data_box
  */
 public function test_box(array $provided, array $expected)
 {
     //$this->markTestIncomplete();
     $p0 = IHashSet\Type::box($provided);
     $this->assertInstanceOf('\\Saber\\Data\\IHashSet\\Type', $p0);
     $p1 = $p0->unbox();
     $e1 = $expected[0];
     $this->assertInternalType('array', $p1);
     $this->assertCount($e1, $p1);
 }
예제 #2
0
 /**
  * This method returns a hash set which represents the asymmetric difference between
  * the two specified hash sets.
  *
  * @access public
  * @static
  * @param IHashSet\Type $xs                                 the first hash set
  * @param IHashSet\Type $ys                                 the second hash set
  * @return IHashSet\Type                                    a hash set which represents the (asymmetric)
  *                                                          difference of the two specified hash sets
  */
 public static function without(IHashSet\Type $xs, IHashSet\Type $ys) : IHashSet\Type
 {
     $zs = IHashSet\Type::box($xs->unbox());
     $yi = IHashSet\Module::iterator($ys);
     foreach ($yi as $y) {
         $zs->removeItem($y);
     }
     return $zs;
 }