mirror of
https://github.com/unclebob/mutator.git
synced 2026-11-06 18:23:50 +00:00
Stop shelling generated test commands and fail closed on git and coverage.
A package path is one argument. Git status uses NUL records and returns git's status. A failed coverage command leaves reports unread, coverage keeps the longest path match, and site walks no longer recurse.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
from pathlib import Path
|
||||
|
||||
from mutator.functions import form_id, is_private, project_functions, sites_in_file
|
||||
from mutator.sites import discover_raw
|
||||
|
||||
|
||||
def _sites(tmp_path: Path, relative: str, source: str):
|
||||
@@ -194,3 +195,11 @@ export function mount(app) {
|
||||
def test_a_quoted_nullish_operator_is_not_a_site(tmp_path):
|
||||
source = 'export function place() {\n return "a ?? b?.c";\n}\n'
|
||||
assert _sites(tmp_path, "src/demo/app.ts", source) == []
|
||||
|
||||
|
||||
def test_a_deep_expression_is_walked(tmp_path):
|
||||
expr = " + ".join(["1"] * 1200)
|
||||
python = f"def place():\n return {expr}\n"
|
||||
assert discover_raw(python, "python", "app.py")
|
||||
go = f"package p\nfunc place() int {{ return {expr} }}\n"
|
||||
assert discover_raw(go, "go", "app.go")
|
||||
|
||||
Reference in New Issue
Block a user