Skip to content

Commit

Permalink
Add a test to verify the issue that zip unnecessarily calls selector
Browse files Browse the repository at this point in the history
  • Loading branch information
vain0x committed Dec 13, 2017
1 parent 6c24d74 commit 8da1567
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/GinqTest.php
Expand Up @@ -1598,6 +1598,10 @@ function($v0, $v1, $k0, $k1) { return "$v1 - $v0"; }
array(6, "7 - red"),
array(7, "8 - green")
), $xs);

// should't call selector if empty.
$actual = Ginq::zero()->zip(Ginq::zero(), function ($v0, $v1) { $this->assertTrue(false); })->count();
$this->assertEquals(0, $actual);
}

/**
Expand Down

0 comments on commit 8da1567

Please sign in to comment.