Skip to content

Commit abd5782

Browse files
committed
fix: tests
1 parent 2bdea29 commit abd5782

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

tests/unit/ReduceIterableAggregateTest.php

+4-5
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
namespace tests\loophp\iterators;
1111

1212
use loophp\iterators\ReduceIterableAggregate;
13-
use loophp\iterators\ReductionIterableAggregate;
1413
use PHPUnit\Framework\TestCase;
1514

1615
/**
@@ -24,20 +23,20 @@ public function testBasic(): void
2423
{
2524
$iterator = (new ReduceIterableAggregate(
2625
range(0, 10),
27-
static fn (int $carry, int $value, int $key, iterable $iterable): int => $carry + $value,
26+
static fn (int $carry, int $value, int $key): int => $carry + $value + $key,
2827
0
2928
));
3029

31-
$expected = [55];
30+
$expected = [110];
3231

3332
self::assertSame($expected, iterator_to_array($iterator));
3433
}
3534

3635
public function testEmptyInput(): void
3736
{
38-
$iterator = (new ReductionIterableAggregate(
37+
$iterator = (new ReduceIterableAggregate(
3938
[],
40-
static fn (int $carry, int $value, int $key, iterable $iterable): int => $carry + $value,
39+
static fn (int $carry, int $value, int $key): int => $carry + $value + $key,
4140
123
4241
));
4342

tests/unit/ReductionIterableAggregateTest.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ public function testBasic(): void
2323
{
2424
$iterator = (new ReductionIterableAggregate(
2525
range(0, 10),
26-
static fn (int $carry, int $value, int $key, iterable $iterable): int => $carry + $value,
26+
static fn (int $carry, int $value, int $key): int => $carry + $value + $key,
2727
0
2828
));
2929

30-
$expected = [0, 1, 3, 6, 10, 15, 21, 28, 36, 45, 55];
30+
$expected = [0, 2, 6, 12, 20, 30, 42, 56, 72, 90, 110];
3131

3232
self::assertSame($expected, iterator_to_array($iterator));
3333
}
@@ -36,7 +36,7 @@ public function testEmptyInput(): void
3636
{
3737
$iterator = (new ReductionIterableAggregate(
3838
[],
39-
static fn (int $carry, int $value, int $key, iterable $iterable): int => $carry + $value,
39+
static fn (int $carry, int $value, int $key): int => $carry + $value + $key,
4040
123
4141
));
4242

0 commit comments

Comments
 (0)