summaryrefslogtreecommitdiff
path: root/tests/test_regressions.py
diff options
context:
space:
mode:
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'