packages/bison-parser/tests/Unit/Ast/Declaration/ExpectTest.php

1<?php
2
3declare(strict_types=1);
4
5namespace Tests\Unit\Ast\Declaration;
6
7use BisonParser\Ast\Declaration\Expect;
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(Expect::class)]
15#[UsesClass(Location::class)]
16#[Small]
17final class ExpectTest extends TestCase
18{
19    public function testLocation(): void
20    {
21        $declaration = new Expect(2, true, new Location(3, 1));
22
23        self::assertSame('3:1', (string) $declaration->location());
24        self::assertSame(2, $declaration->count);
25        self::assertTrue($declaration->reduceReduce);
26    }
27}
28