()
| 376 | |
| 377 | |
| 378 | def 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 | |
| 397 | def test_split_spans(): |