/**
  * This method tests the "drop" method.
  *
  * @dataProvider data_drop
  */
 public function test_drop(array $provided, array $expected)
 {
     $p0 = ILinkedList\Type::make($provided[0], '\\Saber\\Data\\IInt32\\Type');
     $p1 = IInt32\Type::box($provided[1]);
     $r0 = ILinkedList\Module::drop($p0, $p1);
     $e0 = $expected[0];
     $this->assertInstanceOf('\\Saber\\Data\\ILinkedList\\Type', $r0);
     $this->assertSame($e0, $r0->unbox(1));
 }
Exemple #2
0
 /**
  * This method returns a tuple where the first item contains the first "n" items
  * in the linked list and the second item contains the remainder.
  *
  * @access public
  * @static
  * @param ILinkedList\Type $xs                              the linked list
  * @param IInt32\Type $n                                    the number of items to take
  * @return ITuple\Type                                      the tuple
  */
 public static function split(ILinkedList\Type $xs, IInt32\Type $n) : ITuple\Type
 {
     return ITuple\Type::box2(ILinkedList\Module::take($xs, $n), ILinkedList\Module::drop($xs, $n));
 }