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

Function test_split_spans

tests/test_text.py:397–403  ·  tests/test_text.py::test_split_spans
()

Source from the content-addressed store, hash-verified

395
396
397def test_split_spans():
398 text = Text.from_markup(class="st">"[red]Hello\n[b]World")
399 lines = text.split(class="st">"\n")
400 assert lines[0].plain == class="st">"Hello"
401 assert lines[1].plain == class="st">"World"
402 assert lines[0].spans == [Span(0, 5, class="st">"red")]
403 assert lines[1].spans == [Span(0, 5, class="st">"red"), Span(0, 5, class="st">"bold")]
404
405
406def test_divide():

Callers

nothing calls this directly

Calls 3

SpanClass · 0.90
from_markupMethod · 0.80
splitMethod · 0.45

Tested by

no test coverage detected