summaryrefslogtreecommitdiff
path: root/tests/test_format.py
diff options
context:
space:
mode:
authorAndi Albrecht <albrecht.andi@gmail.com>2010-11-21 19:23:12 +0100
committerAndi Albrecht <albrecht.andi@gmail.com>2010-11-21 19:23:12 +0100
commite3a64164683e34a597153005386f9ee53396c6a5 (patch)
treef65b858b5d54b3b584985713f5adc265ced33fc1 /tests/test_format.py
parent08688ee4fc78fea0a6769cfa8738438c0eb8256d (diff)
downloadsqlparse-e3a64164683e34a597153005386f9ee53396c6a5.tar.gz
Ignore AND after BETWEEN when reindenting statements (fixes issue14).
Diffstat (limited to 'tests/test_format.py')
-rw-r--r--tests/test_format.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/test_format.py b/tests/test_format.py
index 88693c0..32e8bef 100644
--- a/tests/test_format.py
+++ b/tests/test_format.py
@@ -104,6 +104,14 @@ class TestFormatReindent(TestCaseBase):
'select *',
'from bar;']))
+ def test_keywords_between(self): # issue 14
+ # don't break AND after BETWEEN
+ f = lambda sql: sqlparse.format(sql, reindent=True)
+ s = 'and foo between 1 and 2 and bar = 3'
+ self.ndiffAssertEqual(f(s), '\n'.join(['',
+ 'and foo between 1 and 2',
+ 'and bar = 3']))
+
def test_parenthesis(self):
f = lambda sql: sqlparse.format(sql, reindent=True)
s = 'select count(*) from (select * from foo);'