Skip to content

Commit f2b58a7

Browse files
committed
SNOW-25251: Added a test case ensuring a single line comment will be part of the following SQL statement
1 parent 982ead3 commit f2b58a7

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

test/test_unit_split_statement.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,3 +441,17 @@ def test_multiple_comments():
441441
"--- test comment 1\n"
442442
"select /*another test comments*/ 1; -- test comment 2", False)
443443
assert next(itr) == ("-- test comment 3\nselect 2;", False)
444+
445+
446+
def test_comments_with_semicolon():
447+
s = """--test ;
448+
select 1;
449+
"""
450+
with StringIO(_to_unicode(s)) as f:
451+
itr = split_statements(f, remove_comments=False)
452+
assert next(itr) == (
453+
"--test ;\n"
454+
"select 1;", False
455+
)
456+
with pytest.raises(StopIteration):
457+
next(itr)

0 commit comments

Comments
 (0)