endtoend-test-psl/tests/Psl/Iter/MergeTest.php

24 lines
509 B
PHP
Raw Normal View History

2020-09-01 07:52:09 +02:00
<?php
declare(strict_types=1);
namespace Psl\Tests\Iter;
use PHPUnit\Framework\TestCase;
use Psl\Iter;
final class MergeTest extends TestCase
2020-09-01 07:52:09 +02:00
{
public function testMap(): void
{
$result = Iter\merge([1, 2], [9, 8]);
$entries = Iter\to_array(Iter\enumerate($result));
static::assertSame($entries[0], [0, 1]);
static::assertSame($entries[1], [1, 2]);
static::assertSame($entries[2], [0, 9]);
static::assertSame($entries[3], [1, 8]);
}
}