@@ 7-15 (lines=9) @@ | ||
4 | ||
5 | use function Prelude\init; |
|
6 | ||
7 | class InitTest extends \PHPUnit\Framework\TestCase |
|
8 | { |
|
9 | public function test() |
|
10 | { |
|
11 | $this->assertEquals([1, 2], init([1, 2, 3])); |
|
12 | $this->assertEquals(['a' => 'a'], init(['a' => 'a', 'b' => 'b'])); |
|
13 | $this->assertEquals([], init([])); |
|
14 | } |
|
15 | } |
|
16 |
@@ 7-18 (lines=12) @@ | ||
4 | ||
5 | use function Prelude\tail; |
|
6 | ||
7 | class TailTest extends \PHPUnit\Framework\TestCase |
|
8 | { |
|
9 | /** |
|
10 | * @test |
|
11 | */ |
|
12 | public function shouldReturnArrayRest() |
|
13 | { |
|
14 | $this->assertEquals([2, 3], tail([1, 2, 3])); |
|
15 | $this->assertEquals(['b' => 'b'], tail(['a' => 'a', 'b' => 'b'])); |
|
16 | $this->assertEquals([], tail([])); |
|
17 | } |
|
18 | } |
|
19 |