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
+25
View File
@@ -0,0 +1,25 @@
import unittest
from task_bench.framework_tests import is_test_file
class IsTestFileTest(unittest.TestCase):
def test_tells_a_php_file_ending_in_Test_wherever_it_stands(self):
for path in ("src/PickTest.php", "PickTest.php", "app/Models/UserTest.php"):
with self.subTest(path=path):
self.assertTrue(is_test_file(path))
def test_tells_the_names_node_test_finds_in_each_suffix_stryker_covers(self):
for path in ("src/pick-test.js", "pick_test.mjs", "src/test-pick.cjs", "src/test.ts", "a/b/pick-test.tsx", "test.jsx", "x_test.mts", "test-x.cts"):
with self.subTest(path=path):
self.assertTrue(is_test_file(path))
def test_tells_what_is_test_tells(self):
for path in ("src/pick.test.js", "src/pick.spec.ts", "tests/pick.php", "a/__tests__/pick.js", "pick_test.go", "test_pick.py"):
with self.subTest(path=path):
self.assertTrue(is_test_file(path))
def test_takes_other_code_as_code(self):
for path in ("src/Pick.php", "src/Tester.php", "src/PickTest.phps", "src/pick.js", "src/latest.js", "src/pick-tests.js", "src/pickTest.js", "src/test-pick.json", "src/contest.ts", "src/Test.php.bak"):
with self.subTest(path=path):
self.assertFalse(is_test_file(path))