Answer principles round 2: 0 🔴, 0 🟡; test located on a path holding a newline, limit run_scores' comment to bin/

This commit is contained in:
2026-10-21 20:11:26 +02:00
parent 50dcb55d51
commit 185efb9bea
2 changed files with 10 additions and 1 deletions
+9
View File
@@ -174,6 +174,15 @@ class Located(unittest.TestCase):
found = main.located()
self.assertEqual(found, Checkout(str(root), str(root), frozenset({"a.txt", "sub/b.txt"})))
def test_fails_in_a_checkout_whose_path_holds_a_newline(self):
temp = tempfile.TemporaryDirectory()
self.addCleanup(temp.cleanup)
root = pathlib.Path(temp.name, "a\nb")
root.mkdir()
subprocess.run(["git", "init", "--quiet"], check=True, cwd=root, env=isolated_env())
with contextlib.chdir(root):
self.assertIsInstance(main.located(), Failure)
if __name__ == "__main__":
unittest.main()