diff options
Diffstat (limited to 'tests/test_format.py')
| -rw-r--r-- | tests/test_format.py | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/test_format.py b/tests/test_format.py index dccc3ec..8151bb4 100644 --- a/tests/test_format.py +++ b/tests/test_format.py @@ -193,6 +193,36 @@ class TestFormatReindentAligned(TestCaseBase): ' and b between 3 and 4' ])) + def test_case_statement_with_between(self): + sql = """ + select a, + case when a = 0 + then 1 + when bb = 1 then 1 + when c = 2 then 2 + when d between 3 and 5 then 3 + else 0 end as d, + extra_col + from table + where c is true + and b between 3 and 4 + """ + self.ndiffAssertEqual( + self.formatter(sql), + '\n'.join([ + 'select a,', + ' case when a = 0 then 1', + ' when bb = 1 then 1', + ' when c = 2 then 2', + ' when d between 3 and 5 then 3', + ' else 0', + ' end as d,', + ' extra_col', + ' from table', + ' where c is true', + ' and b between 3 and 4' + ])) + def test_group_by(self): sql = """ select a, b, c, sum(x) as sum_x, count(y) as cnt_y |
