summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAndi Albrecht <albrecht.andi@gmail.com>2017-04-18 08:50:50 +0200
committerAndi Albrecht <albrecht.andi@gmail.com>2017-04-18 08:50:50 +0200
commitdff274ca46e8a38b2f1615b99a799e3266dc8c5e (patch)
tree84848d6adf443e406917e50f4301e605b3968631 /tests
parent7f8846b43aca5994983651bbcbe18f22386358fe (diff)
downloadsqlparse-dff274ca46e8a38b2f1615b99a799e3266dc8c5e.tar.gz
Re-order parsing so that comparisons are seens as identifiers (fixes #327).
Diffstat (limited to 'tests')
-rw-r--r--tests/test_grouping.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/test_grouping.py b/tests/test_grouping.py
index 72f94f6..76ba651 100644
--- a/tests/test_grouping.py
+++ b/tests/test_grouping.py
@@ -65,6 +65,20 @@ def test_grouping_identifiers():
@pytest.mark.parametrize('s', [
+ '1 as f',
+ 'foo as f',
+ 'foo f',
+ '1/2 as f',
+ '1/2 f',
+ '1<2 as f', # issue327
+ '1<2 f',
+])
+def test_simple_identifiers(s):
+ parsed = sqlparse.parse(s)[0]
+ assert isinstance(parsed.tokens[0], sql.Identifier)
+
+
+@pytest.mark.parametrize('s', [
'foo, bar',
'sum(a), sum(b)',
'sum(a) as x, b as y',