From ee550f11b95b8d38a1be1b86fa674d37ffcb1609 Mon Sep 17 00:00:00 2001 From: Andi Albrecht Date: Sat, 16 Mar 2024 10:19:01 +0100 Subject: [PATCH] Add test case for #542. --- tests/test_format.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/test_format.py b/tests/test_format.py index 70bb8055..a616f360 100644 --- a/tests/test_format.py +++ b/tests/test_format.py @@ -722,3 +722,10 @@ def test_format_right_margin_invalid_option(right_margin): def test_format_right_margin(): # TODO: Needs better test, only raises exception right now sqlparse.format('foo', right_margin="79") + + +def test_format_json_ops(): # issue542 + formatted = sqlparse.format( + "select foo->'bar', foo->'bar';", reindent=True) + expected = "select foo->'bar',\n foo->'bar';" + assert formatted == expected