summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAndi Albrecht <albrecht.andi@gmail.com>2016-09-14 14:45:44 +0200
committerAndi Albrecht <albrecht.andi@gmail.com>2016-09-14 14:45:44 +0200
commit358ad4b9754721f69c6b40333653bd84edb8634f (patch)
treee60e2f544353dc6037203ea7819fe764d36306e3 /tests
parent7dd1ff99fe433d763840172eef7c14dc0c282d4f (diff)
downloadsqlparse-358ad4b9754721f69c6b40333653bd84edb8634f.tar.gz
Fix parsing of names containing special chars (fixes 291).
Diffstat (limited to 'tests')
-rw-r--r--tests/test_tokenize.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/test_tokenize.py b/tests/test_tokenize.py
index 93645d8..22cb90f 100644
--- a/tests/test_tokenize.py
+++ b/tests/test_tokenize.py
@@ -163,3 +163,17 @@ def test_parse_endifloop(s):
p = sqlparse.parse(s)[0]
assert len(p.tokens) == 1
assert p.tokens[0].ttype is T.Keyword
+
+
+@pytest.mark.parametrize('s', [
+ 'foo',
+ 'Foo',
+ 'FOO',
+ 'v$name', # issue291
+])
+def test_parse_identifiers(s):
+ p = sqlparse.parse(s)[0]
+ assert len(p.tokens) == 1
+ token = p.tokens[0]
+ assert str(token) == s
+ assert isinstance(token, sql.Identifier)