Regression test for https://github.com/Textualize/rich/issues/3014
()
| 1064 | |
| 1065 | |
| 1066 | def test_append_tokens() -> None: |
| 1067 | """Regression test for https://github.com/Textualize/rich/issues/3014""" |
| 1068 | |
| 1069 | console = Console() |
| 1070 | t = Text().append_tokens( |
| 1071 | [ |
| 1072 | ( |
| 1073 | "long text that will be wrapped with a control code \r\n", |
| 1074 | "red", |
| 1075 | ), |
| 1076 | ] |
| 1077 | ) |
| 1078 | with console.capture() as capture: |
| 1079 | console.print(t, width=40) |
| 1080 | |
| 1081 | output = capture.get() |
| 1082 | print(repr(output)) |
| 1083 | assert output == "long text that will be wrapped with a \ncontrol code \n\n" |
| 1084 | |
| 1085 | |
| 1086 | def test_append_loop_regression() -> None: |