from textwrap import dedent

import pytest

from pylox.lox import Lox

TEST_SRC = dedent(
    """\
    /*
    This is a multiline block comment
    */
    """
)

EXPECTED_STDOUTS: list[str] = []


def test_block_comment_at_eof(capsys: pytest.CaptureFixture) -> None:
    interpreter = Lox()
    interpreter.run(TEST_SRC)

    assert not interpreter.had_error
    assert not interpreter.had_runtime_error

    all_out = capsys.readouterr().out.splitlines()
    assert all_out == EXPECTED_STDOUTS

[((7, 11, 13, 1), 'textwrap.dedent', 'dedent', ({(8, 4, 12, 7): '"""    /*\n    This is a multiline block comment\n    */\n    """'}, {}), '("""    /*\n    This is a multiline block comment\n    */\n    """)', False, 'from textwrap import dedent\n'), ((19, 18, 19, 23), 'pylox.lox.Lox', 'Lox', ({}, {}), '()', False, 'from pylox.lox import Lox\n')]