packages/bison-parser/tests/Unit/Ast/Rule/RhsItemTest.php
1<?php
2
3declare(strict_types=1);
4
5namespace Tests\Unit\Ast\Rule;
6
7use BisonParser\Ast\Location;
8use BisonParser\Ast\Rule\EmptyItem;
9use BisonParser\Ast\Rule\RhsItem;
10use PHPUnit\Framework\Attributes\CoversClass;
11use PHPUnit\Framework\Attributes\Small;
12use PHPUnit\Framework\Attributes\UsesClass;
13use PHPUnit\Framework\TestCase;
14
15#[CoversClass(RhsItem::class)]
16#[UsesClass(EmptyItem::class)]
17#[UsesClass(Location::class)]
18#[Small]
19final class RhsItemTest extends TestCase
20{
21 public function testLocation(): void
22 {
23 $item = new EmptyItem(new Location(7, 5));
24
25 self::assertSame('7:5', (string) $item->location());
26 }
27}
28