summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAndi Albrecht <albrecht.andi@gmail.com>2011-07-29 20:58:14 +0200
committerAndi Albrecht <albrecht.andi@gmail.com>2011-07-29 20:58:14 +0200
commitc918cc9dc30b3a7684a96feae95fc5c05638360e (patch)
tree749eed3f2622dfc59ae130ea43dbc8a4eea678c6 /tests
parent0ec64528c5fb1efb71122985eab9c7137a80603d (diff)
downloadsqlparse-c918cc9dc30b3a7684a96feae95fc5c05638360e.tar.gz
Add parsing of MS Access column names with braces (fixes issue27).
Diffstat (limited to 'tests')
-rw-r--r--tests/test_parse.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/test_parse.py b/tests/test_parse.py
index 6ff8dd8..5f9bb2d 100644
--- a/tests/test_parse.py
+++ b/tests/test_parse.py
@@ -95,3 +95,10 @@ class SQLParseTest(TestCaseBase):
self.assert_(t[-1].ttype is sqlparse.tokens.Name.Placeholder)
self.assertEqual(t[-1].value, '$a')
+ def test_access_symbol(self): # see issue27
+ t = sqlparse.parse('select a.[foo bar] as foo')[0].tokens
+ self.assert_(isinstance(t[-1], sqlparse.sql.Identifier))
+ self.assertEqual(t[-1].get_name(), 'foo')
+ self.assertEqual(t[-1].get_real_name(), '[foo bar]')
+ self.assertEqual(t[-1].get_parent_name(), 'a')
+