diff options
| author | Andi Albrecht <albrecht.andi@gmail.com> | 2012-12-22 21:32:44 +0100 |
|---|---|---|
| committer | Andi Albrecht <albrecht.andi@gmail.com> | 2012-12-22 21:32:44 +0100 |
| commit | 5bc57bda760727bc5459bca9190a1bd893078e79 (patch) | |
| tree | 576e61f8b69ff0a950d60a52409caa41e52e586b /tests/test_parse.py | |
| parent | 6e8276a8be8c63813ec1f371d670f1aaa25d525c (diff) | |
| download | sqlparse-5bc57bda760727bc5459bca9190a1bd893078e79.tar.gz | |
Fix parsing error with dollar-quoted procedure bodies (fixes issue83).
Diffstat (limited to 'tests/test_parse.py')
| -rw-r--r-- | tests/test_parse.py | 21 |
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 |
