summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAndi Albrecht <albrecht.andi@gmail.com>2015-03-16 07:50:06 +0100
committerAndi Albrecht <albrecht.andi@gmail.com>2015-03-16 07:50:06 +0100
commit9dbcfd31abafe48ee7c646129c40e904ff0a5fac (patch)
tree32e0909ffcf69d10e38f87575ecc0ce2aecc3958 /tests
parentd02a952b7c3f9a01c40630b6bf7699c1e9c95e21 (diff)
downloadsqlparse-9dbcfd31abafe48ee7c646129c40e904ff0a5fac.tar.gz
Support comments starting with '#' character (fixes #178).
Diffstat (limited to 'tests')
-rw-r--r--tests/test_parse.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/test_parse.py b/tests/test_parse.py
index f6e796f..857685b 100644
--- a/tests/test_parse.py
+++ b/tests/test_parse.py
@@ -283,3 +283,13 @@ def test_typed_array_definition():
assert names == ['x', 'y', 'z']
+@pytest.mark.parametrize('sql', [
+ 'select 1 -- foo',
+ 'select 1 # foo' # see issue178
+])
+def test_single_line_comments(sql):
+ p = sqlparse.parse(sql)[0]
+ assert len(p.tokens) == 5
+ assert p.tokens[-1].ttype == T.Comment.Single
+
+