diff --git a/bin/task_bench/test_plant.py b/bin/task_bench/test_plant.py index 2b62d09c..bc4d1f2e 100644 --- a/bin/task_bench/test_plant.py +++ b/bin/task_bench/test_plant.py @@ -124,6 +124,10 @@ class TaskTextTest(unittest.TestCase): output = "--- FAIL: TestPick (0.00s)\n --- FAIL: TestPick/empty (0.00s)\n pick_test.go:42: got 3\n--- FAIL: TestLast (0.00s)\n pick_test.go:50: got 5\nFAIL\n" self.assertEqual(task_text(output), "got 3") + def test_a_line_printed_before_any_tests_mark_is_no_tests_message(self): + self.assertEqual(task_text(" setup_test.go:3: starting\n--- FAIL: TestPick (0.00s)\n pick_test.go:42: got 3\nFAIL\n"), "got 3") + self.assertIsNone(task_text(" setup_test.go:3: starting\n--- FAIL: TestPick (0.00s)\nFAIL\n")) + def test_is_none_where_only_passing_tests_logged(self): self.assertIsNone(task_text("=== RUN TestServer\n server_test.go:12: listening\n--- PASS: TestServer (0.00s)\nPASS\n")) diff --git a/bin/task_bench/test_task_bench.py b/bin/task_bench/test_task_bench.py index 92854980..f1ea4061 100644 --- a/bin/task_bench/test_task_bench.py +++ b/bin/task_bench/test_task_bench.py @@ -256,9 +256,9 @@ class BenchTest(unittest.TestCase): self.assertIn("broken", found.reason) def test_fails_where_no_mutant_becomes_a_bug(self): - # Passing tests with the bug planted: nothing to tell Haiku. + # Passing tests with the bug planted: no message to tell Haiku. (self.repo / "calc_test.go").write_text("exit 0\n") - self.commit("Tests that catch nothing") + self.commit("Tests that pass with the bug") self.assertEqual(self.bench(), Failure("None of the 2 mutants the tests kill becomes a bug: each is on a line the head changed, or the test it fails doesn't print a message.")) def test_a_run_the_api_refuses_fails_the_bench_and_still_removes_what_it_made(self): @@ -563,7 +563,7 @@ class ApiProxyTest(unittest.IsolatedAsyncioTestCase): await writer.drain() writer.close() - # On an address of its own, so a tunnel to any other host finds nothing listening. + # On an address of its own, so a tunnel to any other host doesn't find anything listening. api = await asyncio.start_server(echoed, "127.0.0.2", 0) self.allowed = f"127.0.0.2:{api.sockets[0].getsockname()[1]}" proxy = await asyncio.start_server(lambda reader, writer: api_proxy.served(self.allowed, reader, writer), "127.0.0.1", 0)