()
| 69 | |
| 70 | |
| 71 | def test_getitem(): |
| 72 | content = Content("Hello, world").stylize("blue", 0, 5) |
| 73 | assert content[0].plain == "H" |
| 74 | assert content[0]._spans == [Span(0, 1, "blue")] |
| 75 | assert content[-1].plain == "d" |
| 76 | assert content[-1]._spans == [] |
| 77 | assert content[:2].plain == "He" |
| 78 | assert content[:2]._spans == [Span(0, 2, "blue")] |
| 79 | |
| 80 | |
| 81 | def test_cell_length(): |