summaryrefslogtreecommitdiffstats
path: root/tests/test_parser.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 02:50:21 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 02:50:21 +0000
commitda8fc943704a221b86f0f6938f4131f0dd679f82 (patch)
treebef7144499ea444319403ba8dbf68480ae3a4e39 /tests/test_parser.py
parentAdding upstream version 23.10.0. (diff)
downloadsqlglot-e73131a7a9c27e0f20ef16a0147b7784d8bc9f5b.tar.xz
sqlglot-e73131a7a9c27e0f20ef16a0147b7784d8bc9f5b.zip
Adding upstream version 23.12.1.upstream/23.12.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/test_parser.py')
-rw-r--r--tests/test_parser.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/test_parser.py b/tests/test_parser.py
index 791d352..6bcdb64 100644
--- a/tests/test_parser.py
+++ b/tests/test_parser.py
@@ -87,6 +87,9 @@ class TestParser(unittest.TestCase):
self.assertIsNotNone(parse_one("date").find(exp.Column))
+ def test_tuple(self):
+ parse_one("(a,)").assert_is(exp.Tuple)
+
def test_structs(self):
cast = parse_one("cast(x as struct<int>)")
self.assertIsInstance(cast.to.expressions[0], exp.DataType)
@@ -439,7 +442,7 @@ class TestParser(unittest.TestCase):
self.assertEqual(expression.comments, ["comment2"])
self.assertEqual(expression.this.comments, ["comment3"])
- self.assertEqual(expression.args.get("with").comments, ["comment1.1", "comment1.2"])
+ self.assertEqual(expression.args["with"].comments, ["comment1.1", "comment1.2"])
def test_type_literals(self):
self.assertEqual(parse_one("int 1"), parse_one("CAST(1 AS INT)"))