summaryrefslogtreecommitdiffstats
path: root/tests/test_transpile.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-03-08 07:22:15 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-03-08 07:22:15 +0000
commit5b1ac5070c43c40a2b5bbc991198b0dddf45dc75 (patch)
treeed329138d5e8e5c9d5164b5c853d6f40a116f4d6 /tests/test_transpile.py
parentReleasing debian version 11.3.0-1. (diff)
downloadsqlglot-5b1ac5070c43c40a2b5bbc991198b0dddf45dc75.tar.xz
sqlglot-5b1ac5070c43c40a2b5bbc991198b0dddf45dc75.zip
Merging upstream version 11.3.3.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/test_transpile.py')
-rw-r--r--tests/test_transpile.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/test_transpile.py b/tests/test_transpile.py
index 0463aed..6355400 100644
--- a/tests/test_transpile.py
+++ b/tests/test_transpile.py
@@ -202,9 +202,9 @@ FROM bar /* comment 5 */, tbl /* comment 6 */""",
)
def test_types(self):
- self.validate("INT x", "CAST(x AS INT)")
- self.validate("VARCHAR x y", "CAST(x AS VARCHAR) AS y")
- self.validate("STRING x y", "CAST(x AS TEXT) AS y")
+ self.validate("INT 1", "CAST(1 AS INT)")
+ self.validate("VARCHAR 'x' y", "CAST('x' AS VARCHAR) AS y")
+ self.validate("STRING 'x' y", "CAST('x' AS TEXT) AS y")
self.validate("x::INT", "CAST(x AS INT)")
self.validate("x::INTEGER", "CAST(x AS INT)")
self.validate("x::INT y", "CAST(x AS INT) AS y")
@@ -221,7 +221,7 @@ FROM bar /* comment 5 */, tbl /* comment 6 */""",
self.validate("a NOT BETWEEN b AND c", "NOT a BETWEEN b AND c")
self.validate("a NOT IN (1, 2)", "NOT a IN (1, 2)")
self.validate("a IS NOT NULL", "NOT a IS NULL")
- self.validate("a LIKE TEXT y", "a LIKE CAST(y AS TEXT)")
+ self.validate("a LIKE TEXT 'y'", "a LIKE CAST('y' AS TEXT)")
def test_extract(self):
self.validate(