diff options
Diffstat (limited to 'tests/test_format.py')
| -rw-r--r-- | tests/test_format.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/test_format.py b/tests/test_format.py index 342fe09..72af62e 100644 --- a/tests/test_format.py +++ b/tests/test_format.py @@ -453,6 +453,18 @@ class TestFormatReindent(object): " col3", "from my_table"]) + def test_long_identifier_list_with_functions(self): + f = lambda sql: sqlparse.format(sql, reindent=True, wrap_after=30) + s = ("select 'abc' as foo, json_build_object('a', a," + "'b', b, 'c', c, 'd', d, 'e', e) as col2" + "col3 from my_table") + assert f(s) == '\n'.join([ + "select 'abc' as foo,", + " json_build_object('a',", + " a, 'b', b, 'c', c, 'd', d,", + " 'e', e) as col2col3", + "from my_table"]) + def test_case(self): f = lambda sql: sqlparse.format(sql, reindent=True) s = 'case when foo = 1 then 2 when foo = 3 then 4 else 5 end' |
