Skip to content

Commit

Permalink
Merge pull request #64 from sanmai/pr/legacy/unpack-with-iterators
Browse files Browse the repository at this point in the history
Test that unpack() indeed can process iterators
  • Loading branch information
sanmai authored Oct 19, 2018
2 parents 8847d7b + 47c5171 commit 79f6c8a
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/UnpackTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,18 @@ public function testFlatMap()

$this->assertEquals((10 * 11) / 2, round($pipeline->reduce()));
}

/**
* @covers \Pipeline\Standard::unpack()
*/
public function testWithIterator()
{
$pipeline = new \Pipeline\Standard(new \ArrayIterator([
new \ArrayIterator([1]),
new \Pipeline\Standard(new \ArrayIterator([2])),
[3],
]));

$this->assertSame([1, 2, 3], $pipeline->unpack()->toArray());
}
}

0 comments on commit 79f6c8a

Please sign in to comment.