summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAndi Albrecht <albrecht.andi@gmail.com>2010-06-17 20:21:44 +0200
committerAndi Albrecht <albrecht.andi@gmail.com>2010-06-17 20:21:44 +0200
commitb737d2093eacf3c34e1eb413192f86f0d8623ecd (patch)
tree94a4c346e3e92c0bb05dce06a209fdc249c1a9ee /tests
parent521a87c900a19e39f9e508c898cb191acfc75199 (diff)
downloadsqlparse-b737d2093eacf3c34e1eb413192f86f0d8623ecd.tar.gz
Improve detection of escaped single quotes (fixes issue13, reported by Martin Brochhaus, patch by bluemaro with test case by Dan Carley).
Diffstat (limited to 'tests')
-rw-r--r--tests/regressiontests/issue13.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/regressiontests/issue13.py b/tests/regressiontests/issue13.py
new file mode 100644
index 0000000..d3940e1
--- /dev/null
+++ b/tests/regressiontests/issue13.py
@@ -0,0 +1,16 @@
+import unittest
+
+import sqlparse
+
+
+TEST_SQL = """select 'one';
+select 'two\\'';
+select 'three';"""
+
+
+class TestIssue13(unittest.TestCase):
+
+ def test_quoted(self):
+ parsed = sqlparse.parse(TEST_SQL)
+ self.assertEqual(len(parsed), 3)
+ self.assertEqual(str(parsed[1]).strip(), "select 'two\\'';")