diff options
| author | Soloman Weng <soloman1124@gmail.com> | 2018-03-26 09:38:57 +1000 |
|---|---|---|
| committer | Soloman Weng <soloman1124@gmail.com> | 2018-03-26 09:38:57 +1000 |
| commit | 0fe6e3bac797bdedeeb0714dac080645377f29e2 (patch) | |
| tree | 78800776867696941e79417eb1e6b4ba59926e38 /tests | |
| parent | fb52a01b6467896c38872046ca06ac6a38353ebb (diff) | |
| download | sqlparse-0fe6e3bac797bdedeeb0714dac080645377f29e2.tar.gz | |
Deal with long function params
Diffstat (limited to 'tests')
| -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' |
