Esempio n. 1
0
 public function testFoldLeftRight()
 {
     $seq = new Sequence(['a', 'b', 'c']);
     $rsLeft = $seq->foldLeft('', function ($a, $b) {
         return $a . $b;
     });
     $rsRight = $seq->foldRight('', function ($a, $b) {
         return $a . $b;
     });
     $this->assertEquals('abc', $rsLeft);
     $this->assertEquals('abc', $rsRight);
 }