summaryrefslogtreecommitdiff
path: root/tests/test_regressions.py
diff options
context:
space:
mode:
authorAndi Albrecht <albrecht.andi@gmail.com>2015-07-26 14:35:32 +0200
committerAndi Albrecht <albrecht.andi@gmail.com>2015-07-26 14:35:32 +0200
commit5df394485efbbbc5413b21b9efd6f039ff18fae1 (patch)
tree17a4cd907c79d5e7e75de7cf8c68dbb7dd9f1895 /tests/test_regressions.py
parentd463a753216b5c9e2c7f2b3c8a48fa76cbdb73c2 (diff)
parent8987a3a6b540ea35bbb1f9c5f49f3306501289cd (diff)
downloadsqlparse-v0.2.0.tar.gz
Merge branch 'master' into v0.2.0v0.2.0
Diffstat (limited to 'tests/test_regressions.py')
-rw-r--r--tests/test_regressions.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/test_regressions.py b/tests/test_regressions.py
index 31fda0f..6bd198b 100644
--- a/tests/test_regressions.py
+++ b/tests/test_regressions.py
@@ -248,3 +248,20 @@ def test_null_with_as():
'FROM t1'
])
assert formatted == tformatted
+
+
+def test_issue193_splitting_function():
+ sql = """CREATE FUNCTION a(x VARCHAR(20)) RETURNS VARCHAR(20)
+BEGIN
+ DECLARE y VARCHAR(20);
+ RETURN x;
+END;
+SELECT * FROM a.b;"""
+ splitted = sqlparse.split(sql)
+ assert len(splitted) == 2
+
+
+def test_issue186_get_type():
+ sql = "-- comment\ninsert into foo"
+ p = sqlparse.parse(sql)[0]
+ assert p.get_type() == 'INSERT'