summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/test_regressions.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/test_regressions.py b/tests/test_regressions.py
index d38b8f1..9f3c9a9 100644
--- a/tests/test_regressions.py
+++ b/tests/test_regressions.py
@@ -300,3 +300,14 @@ def test_issue227_gettype_cte():
INSERT INTO elsewhere SELECT * FROM foo JOIN bar;
''')
assert with2_stmt[0].get_type() == 'INSERT'
+
+
+def test_issue207_runaway_format():
+ sql = 'select 1 from (select 1 as one, 2 as two, 3 from dual) t0'
+ p = sqlparse.format(sql, reindent=True)
+ assert p == '\n'.join(["select 1",
+ "from",
+ " (select 1 as one,",
+ " 2 as two,",
+ " 3",
+ " from dual) t0"])