summaryrefslogtreecommitdiffstats
path: root/tests/test_expressions.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-09-25 08:20:06 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-09-25 08:20:06 +0000
commitbd2d949d1f2fb728cf4c429dd3ae9a1510e10182 (patch)
treec051102e5aff0ca2d75e5b96b09968c52114060a /tests/test_expressions.py
parentAdding upstream version 18.5.1. (diff)
downloadsqlglot-bd2d949d1f2fb728cf4c429dd3ae9a1510e10182.tar.xz
sqlglot-bd2d949d1f2fb728cf4c429dd3ae9a1510e10182.zip
Adding upstream version 18.7.0.upstream/18.7.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/test_expressions.py')
-rw-r--r--tests/test_expressions.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/test_expressions.py b/tests/test_expressions.py
index b3ce926..b1b5360 100644
--- a/tests/test_expressions.py
+++ b/tests/test_expressions.py
@@ -14,6 +14,13 @@ class TestExpressions(unittest.TestCase):
def test_depth(self):
self.assertEqual(parse_one("x(1)").find(exp.Literal).depth, 1)
+ def test_iter(self):
+ self.assertEqual([exp.Literal.number(1), exp.Literal.number(2)], list(parse_one("[1, 2]")))
+
+ with self.assertRaises(TypeError):
+ for x in parse_one("1"):
+ pass
+
def test_eq(self):
self.assertNotEqual(exp.to_identifier("a"), exp.to_identifier("A"))