summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJohn Bodley <john.bodley@airbnb.com>2020-01-20 13:09:52 -0800
committerAndi Albrecht <albrecht.andi@gmail.com>2020-02-02 21:19:41 +0100
commit44eacf2e2f4a4255829109a5e67e0c1d2af542da (patch)
treef3f01426f2caaa15096adca34509b584654e5623 /tests
parentaaf5403f05e2cdb4f36a507b92e039c8cc2016a0 (diff)
downloadsqlparse-44eacf2e2f4a4255829109a5e67e0c1d2af542da.tar.gz
[fix] Fixing typed literal regression
Diffstat (limited to 'tests')
-rw-r--r--tests/test_grouping.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/test_grouping.py b/tests/test_grouping.py
index 8162362..6b5bb68 100644
--- a/tests/test_grouping.py
+++ b/tests/test_grouping.py
@@ -33,6 +33,12 @@ def test_grouping_assignment(s):
assert isinstance(parsed.tokens[0], sql.Assignment)
+@pytest.mark.parametrize('s', ["x > DATE '2020-01-01'", "x > TIMESTAMP '2020-01-01 00:00:00'"])
+def test_grouping_typed_literal(s):
+ parsed = sqlparse.parse(s)[0]
+ assert isinstance(parsed[4], sql.TypedLiteral)
+
+
@pytest.mark.parametrize('s, a, b', [
('select a from b where c < d + e', sql.Identifier, sql.Identifier),
('select a from b where c < d + interval \'1 day\'', sql.Identifier, sql.TypedLiteral),