예제 #1
0
 /**
  * This method evaluates whether the left operand is identical to the right operand.
  *
  * @access public
  * @static
  * @param IHashSet\Type $xs                                 the left operand
  * @param Core\Type $ys                                     the right operand
  * @return IBool\Type                                       whether the left operand is identical
  *                                                          to the right operand
  */
 public static function id(IHashSet\Type $xs, Core\Type $ys) : IBool\Type
 {
     // ===
     if ($ys !== null && $xs->__typeOf() === $ys->__typeOf()) {
         if (IInt32\Module::eq($xs->size(), $ys->size())) {
             return IBool\Type::box((string) serialize($xs) == (string) serialize($ys));
         }
     }
     return IBool\Type::false();
 }
예제 #2
0
 /**
  * This method tests that an item is put in the collection.
  *
  * @dataProvider dataPutItem
  */
 public function testPutItem(array $provided, array $expected)
 {
     //$this->markTestIncomplete();
     $p0 = new IHashSet\Type();
     foreach ($provided as $item) {
         $p0->putItem($item);
     }
     $p1 = $p0->size()->unbox();
     $e1 = $expected[0];
     $this->assertSame($e1, $p1);
 }