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

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