from src.agent_tools.document_tools import _document_find_repair_hint def test_minified_svg_spacing_error_returns_exact_source(): tag = "" source = '' + '' * 100 + tag + '' hint = _document_find_repair_hint(source, tag.replace('/>', ' />'), 0) assert repr(tag) in hint assert 'Copy an exact source fragment' in hint def test_tag_boundaries_preserve_greater_than_inside_attribute(): tag = '' assert repr(tag) in _document_find_repair_hint('' + tag + '', tag.replace('/>', ' />'), 0) def test_unrelated_markup_does_not_invent_anchor(): assert not _document_find_repair_hint('ordinary prose', '', 0)