summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAndreas Albrecht <andreas.albrecht@Admins-MacBook-Pro.local>2019-03-10 07:46:06 +0100
committerAndreas Albrecht <andreas.albrecht@Admins-MacBook-Pro.local>2019-03-10 07:46:06 +0100
commitdcf8eb2c1012d2ba7424a351e3bd063e8cf70b8e (patch)
treeaa7b1bd26be8e891baddc89c7377fddd12c03230 /tests
parent6a7eb243274e1f17c0bb99d65272c4313b9ee08c (diff)
parent6c7b89cc8ddbe3159befb4616b70384bf491a29e (diff)
downloadsqlparse-dcf8eb2c1012d2ba7424a351e3bd063e8cf70b8e.tar.gz
Merge branch 'issue_425' of https://github.com/fredyw/sqlparse into fredyw-issue_425
Diffstat (limited to 'tests')
-rw-r--r--tests/test_format.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/test_format.py b/tests/test_format.py
index e87e041..acee9ac 100644
--- a/tests/test_format.py
+++ b/tests/test_format.py
@@ -50,6 +50,19 @@ class TestFormat(object):
sql = 'select-- foo\nfrom -- bar\nwhere'
res = sqlparse.format(sql, strip_comments=True)
assert res == 'select from where'
+ sql = 'select *-- statement starts here\n\nfrom foo'
+ res = sqlparse.format(sql, strip_comments=True)
+ assert res == 'select * from foo'
+ sql = 'select * from foo-- statement starts here\nwhere'
+ res = sqlparse.format(sql, strip_comments=True)
+ assert res == 'select * from foo where'
+ sql = 'select a-- statement starts here\nfrom foo'
+ res = sqlparse.format(sql, strip_comments=True)
+ assert res == 'select a from foo'
+ sql = '--comment\nselect a-- statement starts here\n' \
+ 'from foo--comment\nf'
+ res = sqlparse.format(sql, strip_comments=True)
+ assert res == 'select a from foo f'
def test_strip_comments_invalid_option(self):
sql = 'select-- foo\nfrom -- bar\nwhere'