mirror of
https://github.com/peklaiho/madlisp.git
synced 2024-11-22 21:35:03 +00:00
30 lines
593 B
PHP
30 lines
593 B
PHP
|
<?php
|
||
|
/**
|
||
|
* MadLisp language
|
||
|
* @link http://madlisp.com/
|
||
|
* @copyright Copyright (c) 2020 Pekka Laiho
|
||
|
*/
|
||
|
|
||
|
use PHPUnit\Framework\TestCase;
|
||
|
|
||
|
use MadLisp\MadLispException;
|
||
|
use MadLisp\MList;
|
||
|
|
||
|
class MListTest extends TestCase
|
||
|
{
|
||
|
public function testGet()
|
||
|
{
|
||
|
$list = new MList([1, 2, 3]);
|
||
|
$this->assertSame(2, $list->get(1));
|
||
|
}
|
||
|
|
||
|
public function testNotFound()
|
||
|
{
|
||
|
$this->expectException(MadLispException::class);
|
||
|
$this->expectExceptionMessage('list does not contain index 3');
|
||
|
|
||
|
$list = new MList([1, 2, 3]);
|
||
|
$list->get(3);
|
||
|
}
|
||
|
}
|