summaryrefslogtreecommitdiff
path: root/tests/test_parse.py
diff options
context:
space:
mode:
authorAndi Albrecht <albrecht.andi@gmail.com>2011-09-29 09:33:47 +0200
committerAndi Albrecht <albrecht.andi@gmail.com>2011-09-29 09:33:47 +0200
commitff50b33074f5c276b0cff8094e85582dcd467095 (patch)
tree6f34a60f9d7b62530bb65dfe0c4d7be8eb45abf7 /tests/test_parse.py
parentf811fa12247330adc27f1b842167a112b1c0829c (diff)
downloadsqlparse-ff50b33074f5c276b0cff8094e85582dcd467095.tar.gz
Make keyword detection more restrict (fixes issue47).
Keywords most likely don't follow dots. Maybe there are other exclusions too, but for now let's just go with this one.
Diffstat (limited to 'tests/test_parse.py')
-rw-r--r--tests/test_parse.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/test_parse.py b/tests/test_parse.py
index 5f9bb2d..e14c9e2 100644
--- a/tests/test_parse.py
+++ b/tests/test_parse.py
@@ -102,3 +102,7 @@ class SQLParseTest(TestCaseBase):
self.assertEqual(t[-1].get_real_name(), '[foo bar]')
self.assertEqual(t[-1].get_parent_name(), 'a')
+ def test_keyword_like_identifier(self): # see issue47
+ t = sqlparse.parse('foo.key')[0].tokens
+ self.assertEqual(len(t), 1)
+ self.assert_(isinstance(t[0], sqlparse.sql.Identifier))