diff options
| author | Andi Albrecht <albrecht.andi@gmail.com> | 2020-09-13 09:25:56 +0200 |
|---|---|---|
| committer | Andi Albrecht <albrecht.andi@gmail.com> | 2020-09-13 09:25:56 +0200 |
| commit | 27ad2564f30f1021a96addafb7b7eb6a7504c28f (patch) | |
| tree | 676dc4d25c5f5483e4a622b6652d386c639926db /tests/test_split.py | |
| parent | b4ba0697fc55f36d69506620cf5e50c01670c74b (diff) | |
| download | sqlparse-27ad2564f30f1021a96addafb7b7eb6a7504c28f.tar.gz | |
Don't flush token streams iff they only contain whitespace tokens (fixes #496).
Diffstat (limited to 'tests/test_split.py')
| -rw-r--r-- | tests/test_split.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/test_split.py b/tests/test_split.py index 8214756..c073298 100644 --- a/tests/test_split.py +++ b/tests/test_split.py @@ -139,6 +139,13 @@ def test_split_simple(): assert stmts[1] == 'select * from bar;' +def test_split_ignores_empty_newlines(): + stmts = sqlparse.split('select foo;\nselect bar;\n') + assert len(stmts) == 2 + assert stmts[0] == 'select foo;' + assert stmts[1] == 'select bar;' + + def test_split_quotes_with_new_line(): stmts = sqlparse.split('select "foo\nbar"') assert len(stmts) == 1 |
