diff options
| author | hurcy <cinyoung.hur@gmail.com> | 2020-07-29 14:47:47 +0900 |
|---|---|---|
| committer | Andi Albrecht <albrecht.andi@gmail.com> | 2020-09-13 08:58:20 +0200 |
| commit | 28c4d4026e1d9389a99d8cd627c96fa360c17fc4 (patch) | |
| tree | cc47fc3bea26bf8c8ae634dd9a8d27a25531f9d7 /tests | |
| parent | d5d4bde3d8d74f451befe36d5f6bf3cefde538eb (diff) | |
| download | sqlparse-28c4d4026e1d9389a99d8cd627c96fa360c17fc4.tar.gz | |
add regex pattern to identify IN as a Compasion token
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_grouping.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/test_grouping.py b/tests/test_grouping.py index 683954e..879ba29 100644 --- a/tests/test_grouping.py +++ b/tests/test_grouping.py @@ -371,10 +371,20 @@ def test_grouping_function_not_in(): # issue183 p = sqlparse.parse('in(1, 2)')[0] assert len(p.tokens) == 2 - assert p.tokens[0].ttype == T.Keyword + assert p.tokens[0].ttype == T.Comparison assert isinstance(p.tokens[1], sql.Parenthesis) +def test_in_comparison(): + # issue566 + p = sqlparse.parse('a in (1, 2)')[0] + assert len(p.tokens) == 1 + assert isinstance(p.tokens[0], sql.Comparison) + assert len(p.tokens[0].tokens) == 5 + assert p.tokens[0].left.value == 'a' + assert p.tokens[0].right.value == '(1, 2)' + + def test_grouping_varchar(): p = sqlparse.parse('"text" Varchar(50) NOT NULL')[0] assert isinstance(p.tokens[2], sql.Function) |
