This commit is contained in:
@@ -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"
|
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")
|
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):
|
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"))
|
self.assertIsNone(task_text("=== RUN TestServer\n server_test.go:12: listening\n--- PASS: TestServer (0.00s)\nPASS\n"))
|
||||||
|
|
||||||
|
|||||||
@@ -256,9 +256,9 @@ class BenchTest(unittest.TestCase):
|
|||||||
self.assertIn("broken", found.reason)
|
self.assertIn("broken", found.reason)
|
||||||
|
|
||||||
def test_fails_where_no_mutant_becomes_a_bug(self):
|
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.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."))
|
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):
|
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()
|
await writer.drain()
|
||||||
writer.close()
|
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)
|
api = await asyncio.start_server(echoed, "127.0.0.2", 0)
|
||||||
self.allowed = f"127.0.0.2:{api.sockets[0].getsockname()[1]}"
|
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)
|
proxy = await asyncio.start_server(lambda reader, writer: api_proxy.served(self.allowed, reader, writer), "127.0.0.1", 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user