Skip to content

Commit

Permalink
show partition failure
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexandruGG committed Jul 14, 2021
1 parent 296940f commit 9eaf340
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions spec/loophp/collection/CollectionSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -2133,6 +2133,16 @@ public function it_can_merge(): void
->shouldIterateAs($generator());
}

public function it_reproduces_partition_issue(): void
{
$collection = $this::fromIterable([1, 2, 3, 4, 5]);

[$even, $odd] = $collection->partition(static fn (int $value): bool => $value % 2 === 0)->all();

$even->shouldHaveCount(2);
$even->shouldIterateAs([1 => 2, 3 => 4]);
}

public function it_can_normalize(): void
{
$this::fromIterable(['a' => 10, 'b' => 100, 'c' => 1000])
Expand Down

0 comments on commit 9eaf340

Please sign in to comment.