2019-11-08 16:27:08 -05:00
|
|
|
<?php declare(strict_types=1);
|
|
|
|
|
|
|
|
namespace Aviat\Kilo\Tests;
|
|
|
|
|
|
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
|
2019-11-14 12:14:02 -05:00
|
|
|
use function Aviat\Kilo\get_window_size;
|
|
|
|
use function Aviat\Kilo\is_ascii;
|
|
|
|
|
2019-11-08 16:27:08 -05:00
|
|
|
class FunctionTest extends TestCase {
|
2019-11-14 12:14:02 -05:00
|
|
|
public function test_get_window_size(): void
|
2019-11-14 11:12:32 -05:00
|
|
|
{
|
2019-11-14 12:14:02 -05:00
|
|
|
[$rows, $cols] = get_window_size();
|
|
|
|
$this->assertGreaterThan(0, $rows);
|
|
|
|
$this->assertGreaterThan(0, $cols);
|
|
|
|
}
|
2019-11-14 11:12:32 -05:00
|
|
|
|
2019-11-14 12:14:02 -05:00
|
|
|
public function test_is_ascii(): void
|
|
|
|
{
|
|
|
|
$this->assertFalse(is_ascii('©'));
|
|
|
|
$this->assertFalse(is_ascii("\x80"));
|
|
|
|
$this->assertTrue(is_ascii('a'));
|
2019-11-14 11:12:32 -05:00
|
|
|
}
|
2019-11-08 16:27:08 -05:00
|
|
|
}
|