Skip to content

Commit 4e43bdd

Browse files
committed
Add failing test for LazyCollection@until
1 parent bead456 commit 4e43bdd

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tests/Support/SupportLazyCollectionIsLazyTest.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1100,6 +1100,23 @@ public function testUnlessNotEmptyIsLazy()
11001100
});
11011101
}
11021102

1103+
public function testUntilIsLazy()
1104+
{
1105+
$this->assertDoesNotEnumerate(function ($collection) {
1106+
$collection->until(INF);
1107+
});
1108+
1109+
$this->assertEnumerates(10, function ($collection) {
1110+
$collection->until(10)->all();
1111+
});
1112+
1113+
$this->assertEnumerates(10, function ($collection) {
1114+
$collection->until(function ($item) {
1115+
return $item === 10;
1116+
})->all();
1117+
});
1118+
}
1119+
11031120
public function testUnwrapEnumeratesOne()
11041121
{
11051122
$this->assertEnumeratesOnce(function ($collection) {

0 commit comments

Comments
 (0)