summaryrefslogtreecommitdiff
path: root/tests/test_format.py
diff options
context:
space:
mode:
authorAndi Albrecht <albrecht.andi@gmail.com>2012-04-19 21:21:53 +0200
committerAndi Albrecht <albrecht.andi@gmail.com>2012-04-19 21:21:53 +0200
commit508db7329f05362a47a0ed9f93d0ae8d9e42dcc8 (patch)
treec5f0abbc25fc62a8b285758e6ab0082d169f16e8 /tests/test_format.py
parent748749e596ebf10a9adc763f970cfde446bac978 (diff)
downloadsqlparse-508db7329f05362a47a0ed9f93d0ae8d9e42dcc8.tar.gz
Preserve whitespace after subgroups.
Diffstat (limited to 'tests/test_format.py')
-rw-r--r--tests/test_format.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/test_format.py b/tests/test_format.py
index 7a2c655..c9c6f46 100644
--- a/tests/test_format.py
+++ b/tests/test_format.py
@@ -68,6 +68,12 @@ class TestFormat(TestCaseBase):
self.assertRaises(sqlparse.SQLParseError, sqlparse.format, s,
strip_whitespace=None)
+ def test_preserve_ws(self):
+ # preserve at least one whitespace after subgroups
+ f = lambda sql: sqlparse.format(sql, strip_whitespace=True)
+ s = 'select\n* /* foo */ from bar '
+ self.ndiffAssertEqual(f(s), 'select * /* foo */ from bar')
+
def test_outputformat(self):
sql = 'select * from foo;'
self.assertRaises(sqlparse.SQLParseError, sqlparse.format, sql,