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

Function test_highlight_regex

tests/test_highlighter.py:161–167  ·  view source on GitHub ↗

Tests for the regular expressions used in ReprHighlighter.

(test: str, spans: List[Span])

Source from the content-addressed store, hash-verified

159
160@pytest.mark.parametrize("test, spans", highlight_tests)
161def test_highlight_regex(test: str, spans: List[Span]):
162 """Tests for the regular expressions used in ReprHighlighter."""
163 text = Text(test)
164 highlighter = ReprHighlighter()
165 highlighter.highlight(text)
166 print(text.spans)
167 assert text.spans == spans
168
169
170def test_highlight_json_with_indent():

Callers

nothing calls this directly

Calls 4

TextClass · 0.90
ReprHighlighterClass · 0.90
printFunction · 0.50
highlightMethod · 0.45

Tested by

no test coverage detected