From 002f37dde390ab2f189c579f5fb18e191f7eed89 Mon Sep 17 00:00:00 2001 From: Fredy Wijaya Date: Fri, 9 Mar 2018 14:35:33 -0600 Subject: Fix incorrect splitting with double quotes and a new line --- tests/test_split.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests/test_split.py') diff --git a/tests/test_split.py b/tests/test_split.py index 5d846bf..a93e3d4 100644 --- a/tests/test_split.py +++ b/tests/test_split.py @@ -139,3 +139,13 @@ def test_split_simple(): assert len(stmts) == 2 assert stmts[0] == 'select * from foo;' assert stmts[1] == 'select * from bar;' + + +def test_split_quotes_with_new_line(): + stmts = sqlparse.split('select "foo\nbar"') + assert len(stmts) == 1 + assert stmts[0] == 'select "foo\nbar"' + + stmts = sqlparse.split("select 'foo\n\bar'") + assert len(stmts) == 1 + assert stmts[0] == "select 'foo\n\bar'" -- cgit v1.2.1