summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAndi Albrecht <albrecht.andi@gmail.com>2015-01-16 21:45:32 +0100
committerAndi Albrecht <albrecht.andi@gmail.com>2015-01-16 21:45:32 +0100
commita17db7a7557056728acf5506d3dea6841ad55fa9 (patch)
tree07b9ef8495bbfef326cd4c92676cdcc11498fd12 /tests
parentc8f2febb01bc6d5c5a1973881bf3c48f80a3d3d1 (diff)
downloadsqlparse-a17db7a7557056728acf5506d3dea6841ad55fa9.tar.gz
Improve parsing of inline comments for identifiers (fixes #163).
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 86d4c7a..44a8072 100644
--- a/tests/test_grouping.py
+++ b/tests/test_grouping.py
@@ -131,6 +131,12 @@ class TestGrouping(TestCaseBase):
l = p.tokens[2]
self.assertEqual(len(l.tokens), 13)
+ def test_identifier_list_with_inline_comments(self): # issue163
+ p = sqlparse.parse('foo /* a comment */, bar')[0]
+ self.assert_(isinstance(p.tokens[0], sql.IdentifierList))
+ self.assert_(isinstance(p.tokens[0].tokens[0], sql.Identifier))
+ self.assert_(isinstance(p.tokens[0].tokens[3], sql.Identifier))
+
def test_where(self):
s = 'select * from foo where bar = 1 order by id desc'
p = sqlparse.parse(s)[0]