50 lines
1.5 KiB
PHP
50 lines
1.5 KiB
PHP
<?php declare(strict_types=1);
|
|
|
|
/*
|
|
* Copyright (c) 2020 https://rewiv.com sikofitt@gmail.com
|
|
*
|
|
* This file is a part of Olive BBS
|
|
*
|
|
* This Source Code Form is subject to the
|
|
* terms of the Mozilla Public License, v. 2.0.
|
|
*
|
|
* If a copy of the MPL was not distributed with this file,
|
|
* You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
*
|
|
* ___ ___ ___
|
|
* ( ).-. ( ) ( )
|
|
* .--. | |( __)___ ___ .--. | |.-. | |.-. .--.
|
|
* / \| |(''"( )( / \| / \| / \ / _ \
|
|
* | .-. | | | | | | | | .-. | .-. | .-. |. .' `. ;
|
|
* | | | | | | | | | | | | | | | | | | | || ' | |
|
|
* | | | | | | | | | | | |/ | | | | | | |_\_`.(___)
|
|
* | | | | | | | | | | | ' _.| | | | | | ( ). '.
|
|
* | ' | | | | | ' ' ; | .'.-| ' | | ' | || | `\ |
|
|
* ' `-' | | | | \ `' /' `-' ' `-' ;' `-' ; ; '._,' '
|
|
* `.__.(___(___) '_.' `.__.' `.__. `.__. '.___.'
|
|
*
|
|
*/
|
|
|
|
namespace Olivebbs\Tests\Map;
|
|
|
|
use Olivebbs\Map\CharMap;
|
|
use Olivebbs\Map\IntCharMap;
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
class CharMapTest extends TestCase
|
|
{
|
|
public function testCharMap(): void
|
|
{
|
|
$fromString = CharMap::fromString('ABCDEFG');
|
|
self::assertSame('A', $fromString['A']);
|
|
self::assertSame('G', $fromString['G']);
|
|
}
|
|
|
|
public function testIntCharMap(): void
|
|
{
|
|
$fromString = IntCharMap::fromString('ABCDEFG');
|
|
self::assertSame('A', $fromString[0]);
|
|
self::assertSame('G', $fromString[6]);
|
|
}
|
|
}
|