packages/bison-parser/tests/Unit/Ast/EpilogueTest.php

1<?php
2
3declare(strict_types=1);
4
5namespace Tests\Unit\Ast;
6
7use BisonParser\Ast\Epilogue;
8use BisonParser\Ast\Location;
9use PHPUnit\Framework\Attributes\CoversClass;
10use PHPUnit\Framework\Attributes\Small;
11use PHPUnit\Framework\Attributes\UsesClass;
12use PHPUnit\Framework\TestCase;
13
14#[CoversClass(Epilogue::class)]
15#[UsesClass(Location::class)]
16#[Small]
17final class EpilogueTest extends TestCase
18{
19    public function testCode(): void
20    {
21        $epilogue = new Epilogue("\nint main() {}\n", new Location(9, 3));
22
23        self::assertSame("\nint main() {}\n", $epilogue->code);
24        self::assertSame('9:3', (string) $epilogue->location);
25    }
26}
27