summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/test_format.py32
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/test_format.py b/tests/test_format.py
index 9043e76..2f9ee9f 100644
--- a/tests/test_format.py
+++ b/tests/test_format.py
@@ -106,6 +106,38 @@ class TestFormat(TestCaseBase):
output_format='foo')
+class TestFormatReindentAligned(TestCaseBase):
+ @staticmethod
+ def formatter(sql):
+ return sqlparse.format(sql, reindent_aligned=True)
+
+ def test_basic(self):
+ sql = """
+ select a, b as bb,c from table
+ join (select a * 2 as a from new_table) other
+ on table.a = other.a
+ where c is true
+ and b between 3 and 4
+ or d is 'blue'
+ """
+ self.ndiffAssertEqual(
+ self.formatter(sql),
+ '\n'.join([
+ 'select a,',
+ ' b as bb,',
+ ' c',
+ ' from table',
+ ' join (',
+ ' select a * 2 as a',
+ ' from new_table',
+ ' ) other',
+ ' on table.a = other.a',
+ ' where c is true',
+ ' and b between 3 and 4',
+ " or d is 'blue'",
+ ]))
+
+
class TestFormatReindent(TestCaseBase):
def test_option(self):