summaryrefslogtreecommitdiffstats
path: root/tests/test_transpile.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_transpile.py')
-rw-r--r--tests/test_transpile.py16
1 files changed, 10 insertions, 6 deletions
diff --git a/tests/test_transpile.py b/tests/test_transpile.py
index fb8f831..51805d9 100644
--- a/tests/test_transpile.py
+++ b/tests/test_transpile.py
@@ -93,6 +93,10 @@ class TestTranspile(unittest.TestCase):
def test_comments(self):
self.validate(
+ "SELECT c /* foo */ AS alias",
+ "SELECT c AS alias /* foo */",
+ )
+ self.validate(
"SELECT c AS /* foo */ (a, b, c) FROM t",
"SELECT c AS (a, b, c) /* foo */ FROM t",
)
@@ -366,7 +370,7 @@ WHERE
""",
"""SELECT
col, /* This is testing comments */
- CASE WHEN a THEN b ELSE c END /* 2nd testing comments */ AS d
+ CASE WHEN a THEN b ELSE c END AS d /* 2nd testing comments */
FROM t""",
pretty=True,
)
@@ -571,11 +575,11 @@ FROM base""",
)
def test_time(self):
- self.validate("INTERVAL '1 day'", "INTERVAL '1' day")
- self.validate("INTERVAL '1 days' * 5", "INTERVAL '1' days * 5")
- self.validate("5 * INTERVAL '1 day'", "5 * INTERVAL '1' day")
- self.validate("INTERVAL 1 day", "INTERVAL '1' day")
- self.validate("INTERVAL 2 months", "INTERVAL '2' months")
+ self.validate("INTERVAL '1 day'", "INTERVAL '1' DAY")
+ self.validate("INTERVAL '1 days' * 5", "INTERVAL '1' DAYS * 5")
+ self.validate("5 * INTERVAL '1 day'", "5 * INTERVAL '1' DAY")
+ self.validate("INTERVAL 1 day", "INTERVAL '1' DAY")
+ self.validate("INTERVAL 2 months", "INTERVAL '2' MONTHS")
self.validate("TIMESTAMP '2020-01-01'", "CAST('2020-01-01' AS TIMESTAMP)")
self.validate("TIMESTAMP WITH TIME ZONE '2020-01-01'", "CAST('2020-01-01' AS TIMESTAMPTZ)")
self.validate(