summaryrefslogtreecommitdiff
path: root/tests/test_parse.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_parse.py')
-rw-r--r--tests/test_parse.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/test_parse.py b/tests/test_parse.py
index 59b8e72..6c9cfa9 100644
--- a/tests/test_parse.py
+++ b/tests/test_parse.py
@@ -113,3 +113,24 @@ def test_quoted_identifier():
assert isinstance(t[2], sqlparse.sql.Identifier)
assert t[2].get_name() == 'z'
assert t[2].get_real_name() == 'y'
+
+
+def test_psql_quotation_marks(): # issue83
+ # regression: make sure plain $$ work
+ t = sqlparse.split("""
+ CREATE OR REPLACE FUNCTION testfunc1(integer) RETURNS integer AS $$
+ ....
+ $$ LANGUAGE plpgsql;
+ CREATE OR REPLACE FUNCTION testfunc2(integer) RETURNS integer AS $$
+ ....
+ $$ LANGUAGE plpgsql;""")
+ assert len(t) == 2
+ # make sure $SOMETHING$ works too
+ t = sqlparse.split("""
+ CREATE OR REPLACE FUNCTION testfunc1(integer) RETURNS integer AS $PROC_1$
+ ....
+ $PROC_1$ LANGUAGE plpgsql;
+ CREATE OR REPLACE FUNCTION testfunc2(integer) RETURNS integer AS $PROC_2$
+ ....
+ $PROC_2$ LANGUAGE plpgsql;""")
+ assert len(t) == 2