Skip to content

Commit

Permalink
add failing test for #126
Browse files Browse the repository at this point in the history
  • Loading branch information
mbhall88 committed Feb 17, 2022
1 parent 12d7eb2 commit 497d99c
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/test_formatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,20 @@ def test_comment_support_after_python_code(self):
formatter = setup_formatter(snakecode)
assert formatter.get_formatted() == snakecode

def test_nested_if_statements_with_comments_and_snakecode_inside(self):
"""https://github.com/snakemake/snakefmt/issues/126"""
snakecode = (
"# when using nested if-statements with___\n"
"if True:\n"
f"{TAB * 1}if True:\n"
f"{TAB * 2}ruleorder: __a_ruleorder_and__\n"
"\n"
f"{TAB * 1}# ___any comment, breaks the parsing of the next line\n"
f'{TAB * 1}var = "anything really"\n'
)
formatter = setup_formatter(snakecode)
assert formatter.get_formatted() == snakecode

def test_nested_ifelse_statements(self):
snakecode = (
'if config["a"] is None:\n\n'
Expand Down

0 comments on commit 497d99c

Please sign in to comment.