← baseline_full_v2

rich_3782

failed NO_PATCH NO_PATCH UNSUBMITTED empty_patch(None) · None tool calls · 0 s · Textualize/rich

Task input

Syntax padding

Fixes https://github.com/Textualize/rich/issues/3727

Tool calls (0)

#ToolArgumentsResult
No trace captured.

Test output

show
........................F
=================================== FAILURES ===================================
____________________________ test_padding_plus_wrap ____________________________

    def test_padding_plus_wrap() -> None:
        """Regression test for https://github.com/Textualize/rich/issues/3727"""
        console = Console(width=24, file=io.StringIO(), legacy_windows=False)
        syntax = Syntax(
            "'Hello, World. This should wrap.'",
            lexer="python",
            padding=(0, 3),
            word_wrap=True,
        )
        console.print(syntax)
        output = console.file.getvalue()
        print(repr(output))
        expected = "   'Hello, World.       \n   This should wrap.'   \n"
>       assert output == expected
E       assert "   'Hello, W...p.'        \n" == "   'Hello, W...d wrap.'   \n"
E         
E         -    'Hello, World.       
E         ?                   ^^^
E         +    'Hello, World. Thi   
E         ?                   ^^^
E         -    This should wrap.'   
E         ?   -----
E         +    should wrap.'        
E         ?                    +++++

tests/test_syntax.py:435: AssertionError
----------------------------- Captured stdout call -----------------------------
"   'Hello, World. Thi   \n   should wrap.'        \n"
!!!!!!!!!!!!!!!!!!!!!!!!!! stopping after 1 failures !!!!!!!!!!!!!!!!!!!!!!!!!!!
1 failed, 24 passed in 0.55s