Leave out of a task-bench fix a change Haiku makes to a PHP or JavaScript test that PHPUnit or node --test finds by its name

This commit is contained in:
2026-11-27 21:57:32 +01:00
parent 2abe472919
commit 53b0f6ed30
7 changed files with 58 additions and 8 deletions
+3 -2
View File
@@ -7,7 +7,8 @@ import typing
from failure import Failure
from task_bench.bugs import go_bugs, php_bugs, python_bugs, rust_bugs, typescript_bugs
from mutate_changes.changed_lines import is_test, STRYKER
from mutate_changes.changed_lines import STRYKER
from task_bench.framework_tests import is_test_file
from task_bench.bugs.planted_mutant import Mutant
from mutate_changes.tool_process import Run
@@ -43,7 +44,7 @@ def language_of(path: str, languages: tuple[Language, ...] = LANGUAGES) -> Langu
def place_files(places: str) -> list[str]:
"""The files that hold a place in what `larv-review places` prints and are in a language of LANGUAGES, test files left out, in
the order of their paths."""
return sorted({path for path in PLACE.findall(places) if language_of(path) and not is_test(path)})
return sorted({path for path in PLACE.findall(places) if language_of(path) and not is_test_file(path)})
def killed_mutants(top: str, files: list[str], run: Run, jobs: int, languages: tuple[Language, ...] = LANGUAGES) -> list[Mutant] | Failure:
+3
View File
@@ -39,6 +39,9 @@ class PlaceFilesTest(unittest.TestCase):
def test_names_none_where_the_places_name_only_test_files_or_another_suffix(self):
self.assertEqual(place_files("- `tests/test_geo.py:3` `load`\n- `geo_test.py:3` `load`\n- `notes.pyc:1` `x`\n"), [])
def test_names_none_where_the_places_name_only_php_or_javascript_files_that_phpunit_or_node_test_finds(self):
self.assertEqual(place_files("- `src/PickTest.php:3` `load`\n- `src/pick-test.js:3` `load`\n- `src/Pick.php:3` `load`\n"), ["src/Pick.php"])
class DrawnTest(unittest.TestCase):
MUTANTS = [mutant("a.go", line) for line in range(1, 40)]