Test the join method.
()
| 171 | |
| 172 | |
| 173 | def test_join(): |
| 174 | """Test the join method.""" |
| 175 | |
| 176 | # Edge cases |
| 177 | assert Content("").join([]) == "" |
| 178 | assert Content(".").join([]) == "" |
| 179 | assert Content("").join(["foo"]) == "foo" |
| 180 | assert Content(".").join(["foo"]) == "foo" |
| 181 | |
| 182 | # Join strings and Content |
| 183 | pieces = [Content.styled("foo", "red"), "bar", Content.styled("baz", "blue")] |
| 184 | content = Content(".").join(pieces) |
| 185 | assert content.plain == "foo.bar.baz" |
| 186 | assert content.spans == [Span(0, 3, "red"), Span(8, 11, "blue")] |
| 187 | |
| 188 | |
| 189 | def test_sort(): |