MCPcopy
hub / github.com/Textualize/rich / test_escape_backslash_end

Function test_escape_backslash_end

tests/test_markup.py:47–56  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

45
46
47def test_escape_backslash_end():
48 # https://github.com/Textualize/rich/issues/2987
49 value = "C:\\"
50 assert escape(value) == "C:\\\\"
51
52 escaped_tags = f"[red]{escape(value)}[/red]"
53 assert escaped_tags == "[red]C:\\\\[/red]"
54 escaped_text = Text.from_markup(escaped_tags)
55 assert escaped_text.plain == "C:\\"
56 assert escaped_text.spans == [Span(0, 3, "red")]
57
58
59def test_render_escape():

Callers

nothing calls this directly

Calls 3

escapeFunction · 0.90
SpanClass · 0.90
from_markupMethod · 0.80

Tested by

no test coverage detected