diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_grouping.py | 4 | ||||
| -rw-r--r-- | tests/test_split.py | 7 |
2 files changed, 7 insertions, 4 deletions
diff --git a/tests/test_grouping.py b/tests/test_grouping.py index 879ba29..cf629e9 100644 --- a/tests/test_grouping.py +++ b/tests/test_grouping.py @@ -399,10 +399,6 @@ def test_statement_get_type(): assert f(' update foo').get_type() == 'UPDATE' assert f('\nupdate foo').get_type() == 'UPDATE' assert f('foo').get_type() == 'UNKNOWN' - # Statements that have a whitespace after the closing semicolon - # are parsed as two statements where later only consists of the - # trailing whitespace. - assert f('\n').get_type() == 'UNKNOWN' def test_identifier_with_operators(): 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 |
