"""Source-level checks for Telegram-native reply rendering."""

from pathlib import Path


REPO_ROOT = Path(__file__).resolve().parents[1]


def test_telegram_renderer_supports_safe_markdown_links() -> None:
    text = (REPO_ROOT / "telegram" / "bot.py").read_text()

    assert "MARKDOWN_LINK_RE" in text
    assert "https?://" in text
    assert "_markdown_link_to_telegram_html" in text
    assert '<a href="{url}">{label}</a>' in text
    assert "MARKDOWN_LINK_RE.sub(r\"\\1 (\\2)\", text)" in text
