endtoend-test-psl/tests/Psl/Iter/ReindexTest.php
2020-10-15 11:05:30 +02:00

19 lines
383 B
PHP

<?php
declare(strict_types=1);
namespace Psl\Tests\Iter;
use PHPUnit\Framework\TestCase;
use Psl\Iter;
final class ReindexTest extends TestCase
{
public function testReindex(): void
{
$result = Iter\reindex([1, 2, 3], static fn (int $value): int => $value);
static::assertSame([1 => 1, 2 => 2, 3 => 3], Iter\to_array_with_keys($result));
}
}