diff options
| author | Victor Uriarte <victor.m.uriarte@intel.com> | 2016-06-19 07:50:50 -0700 |
|---|---|---|
| committer | Victor Uriarte <victor.m.uriarte@intel.com> | 2016-06-19 07:52:46 -0700 |
| commit | b3700f44ff6945d1ace9d5d809dd272c9acd268e (patch) | |
| tree | c4b67697f8158006eaa2ad26fadbcb06817a4c7f /tests | |
| parent | 24f0d3d650d4a83214c4a9539aa04cf4f3045f06 (diff) | |
| download | sqlparse-b3700f44ff6945d1ace9d5d809dd272c9acd268e.tar.gz | |
Previous fix for period failed when another token (non-groupable) followed.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_grouping.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/test_grouping.py b/tests/test_grouping.py index 107900b..bf6bfeb 100644 --- a/tests/test_grouping.py +++ b/tests/test_grouping.py @@ -93,6 +93,15 @@ class TestGrouping(TestCaseBase): self.assertEqual(p.tokens[0].get_real_name(), None) self.assertEqual(p.tokens[0].get_parent_name(), 'a') + def test_identifier_invalid_in_middle(self): + # issue261 + s = 'SELECT foo. FROM foo' + p = sqlparse.parse(s)[0] + assert isinstance(p[2], sql.Identifier) + assert p[2][1].ttype == T.Punctuation + assert p[3].ttype == T.Whitespace + assert str(p[2]) == 'foo.' + def test_identifier_as_invalid(self): # issue8 p = sqlparse.parse('foo as select *')[0] self.assert_(len(p.tokens), 5) |
