from hermes_meshtastic.adapter import strip_markdown, chunk_text def test_strip_markdown(): raw = "# Heading\n**bold text** and *italic* with `inline code`\n- bullet 1\n- bullet 2" cleaned = strip_markdown(raw) assert "**" not in cleaned assert "*" not in cleaned assert "`" not in cleaned assert "#" not in cleaned assert "bold text and italic with inline code" in cleaned def test_chunk_text_small(): text = "Short LoRa message." chunks = chunk_text(text, limit=180) assert len(chunks) == 1 assert chunks[0] == text def test_chunk_text_long(): text = "Word " * 50 # 250 characters chunks = chunk_text(text, limit=100) assert len(chunks) > 1 for c in chunks: assert len(c) <= 100