From a17db7a7557056728acf5506d3dea6841ad55fa9 Mon Sep 17 00:00:00 2001 From: Andi Albrecht Date: Fri, 16 Jan 2015 21:45:32 +0100 Subject: Improve parsing of inline comments for identifiers (fixes #163). --- tests/test_grouping.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tests') 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] -- cgit v1.2.1