From 341143e294c842d700dfd3c6a6224c05d8b8b8d6 Mon Sep 17 00:00:00 2001 From: Andi Albrecht Date: Fri, 5 Apr 2013 05:46:41 +0200 Subject: Add order criterion to identifier in ORDER BY clause (fixes #89). --- tests/test_format.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tests/test_format.py') diff --git a/tests/test_format.py b/tests/test_format.py index c33ac93..17bdc17 100644 --- a/tests/test_format.py +++ b/tests/test_format.py @@ -267,3 +267,14 @@ class TestOutputFormat(TestCaseBase): sql = 'select * from foo;' f = lambda sql: sqlparse.format(sql, output_format='sql') self.ndiffAssertEqual(f(sql), 'select * from foo;') + + +def test_format_column_ordering(): # issue89 + sql = 'select * from foo order by c1 desc, c2, c3;' + formatted = sqlparse.format(sql, reindent=True) + expected = '\n'.join(['select *', + 'from foo', + 'order by c1 desc,', + ' c2,', + ' c3;']) + assert formatted == expected -- cgit v1.2.1