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

Function test_split

tests/test_text.py:378–394  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

376
377
378def test_split():
379 text = Text()
380 text.append("foo", "red")
381 text.append("\n")
382 text.append("bar", "green")
383 text.append("\n")
384
385 line1 = Text()
386 line1.append("foo", "red")
387 line2 = Text()
388 line2.append("bar", "green")
389 split = text.split("\n")
390 assert len(split) == 2
391 assert split[0] == line1
392 assert split[1] == line2
393
394 assert list(Text("foo").split("\n")) == [Text("foo")]
395
396
397def test_split_spans():

Callers

nothing calls this directly

Calls 4

appendMethod · 0.95
splitMethod · 0.95
TextClass · 0.90
splitMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…