packages/sql-semantics-sqlite/tests/Unit/Model/Diagnostic/ImplementationGapTest.php
1<?php
2
3declare(strict_types=1);
4
5namespace Tests\Unit\Model\Diagnostic;
6
7use PHPUnit\Framework\Attributes\CoversClass;
8use PHPUnit\Framework\Attributes\Small;
9use PHPUnit\Framework\TestCase;
10use SqlParser\Parser\Node;
11use SqlSemantics\Platform\Sqlite\Model\Diagnostic\ImplementationGap;
12use SqlSemantics\Platform\Sqlite\Model\Lowering\Form;
13
14#[CoversClass(ImplementationGap::class)]
15#[Small]
16final class ImplementationGapTest extends TestCase
17{
18 public function testProductionNamesTheUnclaimedSignature(): void
19 {
20 $form = new Form(new Node('where_opt', 1, []), 'where_opt: WHERE expr');
21
22 $gap = ImplementationGap::production($form);
23
24 self::assertSame('No semantic rule is implemented for: where_opt: WHERE expr', $gap->getMessage());
25 }
26
27 public function testRuleNamesTheObligation(): void
28 {
29 $gap = ImplementationGap::rule('rendering of window frames');
30
31 self::assertSame('No semantic rule is implemented for: rendering of window frames', $gap->getMessage());
32 }
33}
34