diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-02-19 13:44:59 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-02-19 13:44:59 +0000 |
commit | ef2db38de92f2329c1c366318bddfc7e3dee8415 (patch) | |
tree | dee41de1eb0e05f2f6805b77df41a71b3aa66ec2 /tests/test_expressions.py | |
parent | Adding upstream version 11.0.1. (diff) | |
download | sqlglot-ef2db38de92f2329c1c366318bddfc7e3dee8415.tar.xz sqlglot-ef2db38de92f2329c1c366318bddfc7e3dee8415.zip |
Adding upstream version 11.1.3.upstream/11.1.3
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/test_expressions.py')
-rw-r--r-- | tests/test_expressions.py | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/tests/test_expressions.py b/tests/test_expressions.py index 7acc0fa..8b74fe1 100644 --- a/tests/test_expressions.py +++ b/tests/test_expressions.py @@ -406,6 +406,8 @@ class TestExpressions(unittest.TestCase): ) def test_functions(self): + self.assertIsInstance(parse_one("x LIKE ANY (y)"), exp.Like) + self.assertIsInstance(parse_one("x ILIKE ANY (y)"), exp.ILike) self.assertIsInstance(parse_one("ABS(a)"), exp.Abs) self.assertIsInstance(parse_one("APPROX_DISTINCT(a)"), exp.ApproxDistinct) self.assertIsInstance(parse_one("ARRAY(a)"), exp.Array) @@ -473,23 +475,24 @@ class TestExpressions(unittest.TestCase): self.assertIsInstance(parse_one("GENERATE_SERIES(a, b, c)"), exp.GenerateSeries) def test_column(self): - dot = parse_one("a.b.c") - column = dot.this - self.assertEqual(column.table, "a") - self.assertEqual(column.name, "b") - self.assertEqual(dot.text("expression"), "c") + column = parse_one("a.b.c.d") + self.assertEqual(column.catalog, "a") + self.assertEqual(column.db, "b") + self.assertEqual(column.table, "c") + self.assertEqual(column.name, "d") column = parse_one("a") self.assertEqual(column.name, "a") self.assertEqual(column.table, "") - fields = parse_one("a.b.c.d") + fields = parse_one("a.b.c.d.e") self.assertIsInstance(fields, exp.Dot) - self.assertEqual(fields.text("expression"), "d") - self.assertEqual(fields.this.text("expression"), "c") + self.assertEqual(fields.text("expression"), "e") column = fields.find(exp.Column) - self.assertEqual(column.name, "b") - self.assertEqual(column.table, "a") + self.assertEqual(column.name, "d") + self.assertEqual(column.table, "c") + self.assertEqual(column.db, "b") + self.assertEqual(column.catalog, "a") column = parse_one("a[0].b") self.assertIsInstance(column, exp.Dot) @@ -505,8 +508,8 @@ class TestExpressions(unittest.TestCase): self.assertIsInstance(parse_one("*"), exp.Star) def test_text(self): - column = parse_one("a.b.c") - self.assertEqual(column.text("expression"), "c") + column = parse_one("a.b.c.d.e") + self.assertEqual(column.text("expression"), "e") self.assertEqual(column.text("y"), "") self.assertEqual(parse_one("select * from x.y").find(exp.Table).text("db"), "x") self.assertEqual(parse_one("select *").name, "") |