summaryrefslogtreecommitdiff
path: root/tests/test_parse.py
diff options
context:
space:
mode:
authorAndi Albrecht <albrecht.andi@gmail.com>2013-09-28 08:40:31 +0200
committerAndi Albrecht <albrecht.andi@gmail.com>2013-09-28 08:40:31 +0200
commitf4a152924fc6df8f42c9006f9f07aa3d26d78e82 (patch)
tree249e179f0cafbfbfaa6b6cd6264f3d2558a7d538 /tests/test_parse.py
parent3df9bf4054d6dff589a50225d87be11fa4817c2e (diff)
downloadsqlparse-f4a152924fc6df8f42c9006f9f07aa3d26d78e82.tar.gz
Fix tagging of identifiers by not taking single quoted strings into account (fixes #111).
Diffstat (limited to 'tests/test_parse.py')
-rw-r--r--tests/test_parse.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/test_parse.py b/tests/test_parse.py
index 953a237..ea29f88 100644
--- a/tests/test_parse.py
+++ b/tests/test_parse.py
@@ -157,3 +157,15 @@ def test_scientific_numbers(num):
p = sqlparse.parse(num)[0].tokens
assert len(p) == 1
assert p[0].ttype is T.Number.Float
+
+
+def test_single_quotes_are_strings():
+ p = sqlparse.parse("'foo'")[0].tokens
+ assert len(p) == 1
+ assert p[0].ttype is T.String.Single
+
+
+def test_double_quotes_are_identifiers():
+ p = sqlparse.parse('"foo"')[0].tokens
+ assert len(p) == 1
+ assert isinstance(p[0], sqlparse.sql.Identifier)