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

Function test_split_spans

tests/test_text.py:397–403  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

395
396
397def test_split_spans():
398 text = Text.from_markup("[red]Hello\n[b]World")
399 lines = text.split("\n")
400 assert lines[0].plain == "Hello"
401 assert lines[1].plain == "World"
402 assert lines[0].spans == [Span(0, 5, "red")]
403 assert lines[1].spans == [Span(0, 5, "red"), Span(0, 5, "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

Used in the wild real call sites across dependent graphs

searching dependent graphs…