diff options
| author | John Bodley <john.bodley@airbnb.com> | 2020-01-20 13:09:52 -0800 |
|---|---|---|
| committer | Andi Albrecht <albrecht.andi@gmail.com> | 2020-02-02 21:19:41 +0100 |
| commit | 44eacf2e2f4a4255829109a5e67e0c1d2af542da (patch) | |
| tree | f3f01426f2caaa15096adca34509b584654e5623 /tests | |
| parent | aaf5403f05e2cdb4f36a507b92e039c8cc2016a0 (diff) | |
| download | sqlparse-44eacf2e2f4a4255829109a5e67e0c1d2af542da.tar.gz | |
[fix] Fixing typed literal regression
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_grouping.py | 6 |
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), |
