summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndi Albrecht <albrecht.andi@gmail.com>2009-07-12 09:53:45 +0200
committerAndi Albrecht <albrecht.andi@gmail.com>2009-07-12 09:53:45 +0200
commitd899c928f8839cb85b06ced865eb65d1684f3ad8 (patch)
tree2b1e05ca9c346222a140239660d90db6fe287826
parent612c7fd4c2394be0e04cd7b26c380088bfa20306 (diff)
downloadsqlparse-d899c928f8839cb85b06ced865eb65d1684f3ad8.tar.gz
Add formatting test case for complex identifier lists.
-rw-r--r--tests/test_format.py10
1 files changed, 10 insertions, 0 deletions
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'