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