packages/ztd-query-postgres/tests/Unit/Sql/Lexing/CommentSpanTest.php

1<?php
2
3declare(strict_types=1);
4
5namespace Tests\Unit\Sql\Lexing;
6
7use PHPUnit\Framework\Attributes\CoversClass;
8use PHPUnit\Framework\TestCase;
9
10#[CoversClass(\ZtdQuery\Platform\Postgres\Sql\Lexing\CommentSpan::class)]
11final class CommentSpanTest extends TestCase
12{
13    public function testEndHandlesNestedAndUnterminatedComments(): void
14    {
15        self::assertSame(17, \ZtdQuery\Platform\Postgres\Sql\Lexing\CommentSpan::end('/* a /* b */ c */tail', 0));
16        self::assertSame(7, \ZtdQuery\Platform\Postgres\Sql\Lexing\CommentSpan::end('/* open', 0));
17    }
18}
19