summaryrefslogtreecommitdiffstats
path: root/tests/test_transpile.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-03-08 07:22:12 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-03-08 07:22:12 +0000
commit243d9a15edd910136313a7a9fa7d7f24b494e169 (patch)
tree22d768ca708dc5caa8230705a9155ba1a343502b /tests/test_transpile.py
parentAdding upstream version 11.3.0. (diff)
downloadsqlglot-243d9a15edd910136313a7a9fa7d7f24b494e169.tar.xz
sqlglot-243d9a15edd910136313a7a9fa7d7f24b494e169.zip
Adding upstream version 11.3.3.upstream/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(