mirror of
https://github.com/danog/endtoend-test-psl.git
synced 2024-12-11 00:29:48 +01:00
23 lines
532 B
PHP
23 lines
532 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Psl\Tests\Dict;
|
|
|
|
use PHPUnit\Framework\TestCase;
|
|
use Psl\Dict;
|
|
use Psl\Iter;
|
|
|
|
final class FromKeysTest extends TestCase
|
|
{
|
|
public function testFromKeys(): void
|
|
{
|
|
$actual = Dict\from_keys(['hello', 'world'], static fn (string $_key) => false);
|
|
|
|
static::assertSame('hello', Iter\first_key($actual));
|
|
static::assertSame('world', Iter\last_key($actual));
|
|
static::assertFalse(Iter\first($actual));
|
|
static::assertFalse(Iter\last($actual));
|
|
}
|
|
}
|