diff options
Diffstat (limited to 'tests/test_transpile.py')
-rw-r--r-- | tests/test_transpile.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/test_transpile.py b/tests/test_transpile.py index 95fba30..22085b3 100644 --- a/tests/test_transpile.py +++ b/tests/test_transpile.py @@ -124,6 +124,10 @@ class TestTranspile(unittest.TestCase): "SELECT * FROM t1 /* x */ UNION ALL SELECT * FROM t2", ) self.validate( + "/* comment */ SELECT * FROM a UNION SELECT * FROM b", + "/* comment */ SELECT * FROM a UNION SELECT * FROM b", + ) + self.validate( "SELECT * FROM t1\n/*x*/\nINTERSECT ALL SELECT * FROM t2", "SELECT * FROM t1 /* x */ INTERSECT ALL SELECT * FROM t2", ) @@ -524,6 +528,28 @@ INNER JOIN y USING (id)""", pretty=True, ) + self.validate( + """with x as ( + SELECT * + /* +NOTE: LEFT JOIN because blah blah blah + */ + FROM a +) +select * from x""", + """WITH x AS ( + SELECT + * + /* +NOTE: LEFT JOIN because blah blah blah + */ + FROM a +) +SELECT + * +FROM x""", + pretty=True, + ) def test_types(self): self.validate("INT 1", "CAST(1 AS INT)") |