<?php

declare(strict_types=1);

namespace Tempest\Highlight\Tests\Languages\Php\Patterns;

use PHPUnit\Framework\TestCase;
use Tempest\Highlight\Languages\Php\Patterns\SinglelineCommentPattern;
use Tempest\Highlight\Tests\TestsPatterns;

class SinglelineDocCommentPatternTest extends TestCase
{
    use TestsPatterns;

    public function test_pattern()
    {
        $this->assertMatches(
            pattern: new SinglelineCommentPattern(),
            content: '$bar // foo',
            expected: '// foo',
        );

        $this->assertMatches(
            pattern: new SinglelineCommentPattern(),
            content: '$bar # foo',
            expected: '# foo',
        );

        $this->assertMatches(
            pattern: new SinglelineCommentPattern(),
            content: '$bar #[IncompleteAttribute',
            expected: null,
        );

        $this->assertMatches(
            pattern: new SinglelineCommentPattern(),
            content: '$bar #[Attribute]',
            expected: null,
        );
    }
}
