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

21 lines
397 B
PHP

<?php
declare(strict_types=1);
namespace Psl\Tests\Iter;
use PHPUnit\Framework\TestCase;
use Psl\Collection\MutableVector;
use Psl\Iter;
final class ApplyTest extends TestCase
{
public function testApply(): void
{
$vec = new MutableVector([]);
Iter\apply([1, 2, 3], static fn (int $i) => $vec->add($i));
static::assertSame([1, 2, 3], $vec->toArray());
}
}