From d899c928f8839cb85b06ced865eb65d1684f3ad8 Mon Sep 17 00:00:00 2001 From: Andi Albrecht Date: Sun, 12 Jul 2009 09:53:45 +0200 Subject: Add formatting test case for complex identifier lists. --- tests/test_format.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/test_format.py b/tests/test_format.py index de65eae..a430381 100644 --- a/tests/test_format.py +++ b/tests/test_format.py @@ -159,6 +159,16 @@ class TestFormatReindent(TestCaseBase): 'from a,', ' b'])) + def test_identifier_list_with_functions(self): + f = lambda sql: sqlparse.format(sql, reindent=True) + s = ("select 'abc' as foo, coalesce(col1, col2)||col3 as bar," + "col3 from my_table") + self.ndiffAssertEqual(f(s), '\n'.join( + ["select 'abc' as foo,", + " coalesce(col1, col2)||col3 as bar,", + " col3", + "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' -- cgit v1.2.1