Skip to content

Commit 906af24

Browse files
authored
Add tests for str() + Content() fix
1 parent 08a7e26 commit 906af24

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/test_content.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,14 @@ def test_add() -> None:
136136
assert content.spans == [Span(0, 3, "red"), Span(4, 7, "blue")]
137137
assert content.cell_length == 7
138138

139+
def test_radd() -> NOne
140+
"""Test reverse addition."""
141+
assert "foo" + Content("bar") == Content("foobar")
142+
143+
# Test spans after addition
144+
content = "foo " + Content.styled("bar", "blue")
145+
assert str(content) == "foo bar"
146+
assert content.spans == [Span(4, 7, "blue")]
139147

140148
def test_from_markup():
141149
"""Test simple parsing of content markup."""

0 commit comments

Comments
 (0)