summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAndi Albrecht <albrecht.andi@gmail.com>2011-06-10 22:08:10 +0200
committerAndi Albrecht <albrecht.andi@gmail.com>2011-06-10 22:08:10 +0200
commitf6f2e20e4c61d50fbd5cbf0e685b03d8c5927a3a (patch)
treea7ab16a37315dbace58d6a87e9d4574eb5b382b2 /tests
parent47e7f56a52870bdb278225fc05866efcb5e65a1d (diff)
downloadsqlparse-f6f2e20e4c61d50fbd5cbf0e685b03d8c5927a3a.tar.gz
Fix removal of comments when strip_comments is True (fixes issue38).
Diffstat (limited to 'tests')
-rw-r--r--tests/test_regressions.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/test_regressions.py b/tests/test_regressions.py
index cbe1234..6624d33 100644
--- a/tests/test_regressions.py
+++ b/tests/test_regressions.py
@@ -39,3 +39,10 @@ class RegressionTests(TestCaseBase):
self.ndiffAssertEqual(sql, "\n".join(["select *",
"from foo",
"where bar = 1 limit 1"]))
+
+ def test_issue38(self):
+ sql = sqlparse.format("SELECT foo; -- comment",
+ strip_comments=True)
+ self.ndiffAssertEqual(sql, "SELECT foo;")
+ sql = sqlparse.format("/* foo */", strip_comments=True)
+ self.ndiffAssertEqual(sql, "")