Test that the search for Rust test files leaves a link unread

This commit is contained in:
2026-11-27 16:33:58 +01:00
parent eb2c54ec94
commit 001dfcfc85
+5
View File
@@ -838,6 +838,11 @@ class CheckedTreeTest(unittest.TestCase):
with self.subTest(name):
self.assertEqual(rust_test_files(self.tree(name.replace(" ", "-"), files)), found)
def test_leaves_a_rust_link_unread_whatever_it_points_at_when_it_looks_for_test_files(self):
tree = self.tree("linked", {"src/lib.rs": self.DECLARING, "src/tests.rs": ""})
os.symlink("missing.rs", os.path.join(tree, "src/ghost.rs"))
self.assertEqual(rust_test_files(tree), {"src/tests.rs"})
def test_cannot_find_a_rust_test_file_that_is_not_where_its_declaration_puts_it_or_cannot_be_read_from_it(self):
cases = {
"missing": {"src/lib.rs": self.DECLARING},