Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions coverage_sh/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
TMP_PATH = Path(os.environ.get("XDG_RUNTIME_DIR", "/tmp")) # noqa: S108
TRACEFILE_PREFIX = "shelltrace"
EXECUTABLE_NODE_TYPES = {
"subshell",
"redirected_statement",
"variable_assignment",
"variable_assignments",
Expand All @@ -51,7 +50,6 @@
"while_statement",
"if_statement",
"case_statement",
"pipeline",
"list",
}
SUPPORTED_MIME_TYPES = {"text/x-shellscript"}
Expand Down
35 changes: 35 additions & 0 deletions tests/test_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,41 @@ def test_lines_should_return_executable_lines(self, tmp_path: Path) -> None:
pytest.param(
"case x in\n x) echo match ;;\nesac\n", {2, 3}, id="esac_excluded"
),
pytest.param(
"""\
echo aaa
func()
{
echo bbb
}
func
""",
{2, 5, 7},
id="func_brace",
),
pytest.param(
"""\
echo aaa
func()
(
echo aaa
)
func
""",
{2, 5, 7},
id="func_paren",
),
pytest.param(
"""\
{
echo aaa
# comment
echo bbb
} | grep a
""",
{3, 5, 6},
id="long_pipeline",
),
],
)
def test_executable_lines(
Expand Down
Loading