summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAndi Albrecht <albrecht.andi@gmail.com>2010-11-14 22:03:13 +0100
committerAndi Albrecht <albrecht.andi@gmail.com>2010-11-14 22:03:13 +0100
commitfbaf4c2b596239e2ba2b88e36ac671672d94b1f3 (patch)
treee6e151d9deeef04b3a7c53578edeccdb4f30839d /tests
parent51bd3d5e1603676ab245fd6637b7c7fc9de342f6 (diff)
downloadsqlparse-fbaf4c2b596239e2ba2b88e36ac671672d94b1f3.tar.gz
Match single line comments at end of string.
The bug was reported for CrunchyFrog: http://code.google.com/p/crunchyfrog/issues/detail?id=88
Diffstat (limited to 'tests')
-rw-r--r--tests/test_split.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/test_split.py b/tests/test_split.py
index 50b3a6b..1995ca5 100644
--- a/tests/test_split.py
+++ b/tests/test_split.py
@@ -53,6 +53,16 @@ class SQLSplitTest(TestCaseBase):
self.assertEqual(len(stmts), 3)
self.ndiffAssertEqual(''.join(unicode(q) for q in stmts), sql)
+ def test_dashcomments_eol(self):
+ stmts = sqlparse.parse('select foo; -- comment\n')
+ self.assertEqual(len(stmts), 1)
+ stmts = sqlparse.parse('select foo; -- comment\r')
+ self.assertEqual(len(stmts), 1)
+ stmts = sqlparse.parse('select foo; -- comment\r\n')
+ self.assertEqual(len(stmts), 1)
+ stmts = sqlparse.parse('select foo; -- comment')
+ self.assertEqual(len(stmts), 1)
+
def test_begintag(self):
sql = load_file('begintag.sql')
stmts = sqlparse.parse(sql)