Skip to content

Commit 79f3c63

Browse files
committed
test: adding a separate test for the example
1 parent e872995 commit 79f3c63

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

tests/test_formatter.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,15 +341,25 @@ def test_arg_very_looong(self):
341341
actual = setup_formatter(snakecode).get_formatted()
342342
assert actual == expected
343343

344-
def test_param_inline_formatting(self):
345-
"""issue 208, 240 and 242"""
344+
def test_param_comment_multiline(self):
345+
"""issue 208"""
346346
snakecode = (
347347
f"rule call_variants:\n"
348348
f"{TAB * 1}input:\n"
349349
f"{TAB * 2}data=(\n"
350350
f"{TAB * 3}# a comment on the below\n"
351351
f'{TAB * 3}"input_1.txt"\n'
352+
f"{TAB * 3}if condition\n"
353+
f'{TAB * 3}else "input_2.txt"\n'
352354
f"{TAB * 2}),\n"
355+
)
356+
actual = setup_formatter(snakecode).get_formatted()
357+
assert actual == snakecode
358+
359+
def test_param_inline_formatting(self):
360+
"""issue 240 and 242"""
361+
snakecode = (
362+
f"rule call_variants:\n"
353363
f"{TAB * 1}threads:\n"
354364
f"{TAB * 2}max(\n"
355365
f"{TAB * 3}1,\n"

0 commit comments

Comments
 (0)