MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / test_find_repository_root_in_parent

Function test_find_repository_root_in_parent

atomic-cli/src/commands/mod.rs:669–685  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

667
668 #[test]
669 fn test_find_repository_root_in_parent() {
670 let temp = TempDir::new().unwrap();
671 std::fs::create_dir(temp.path().join(DOT_DIR)).unwrap();
672
673 let subdir = temp.path().join("subdir").join("deep");
674 std::fs::create_dir_all(&subdir).unwrap();
675
676 let result = find_repository_root_from(&subdir);
677 assert!(result.is_ok());
678 // Compare canonical paths to handle macOS /private/var vs /var symlinks
679 let expected = temp
680 .path()
681 .canonicalize()
682 .unwrap_or_else(|_| temp.path().to_path_buf());
683 let actual = result.unwrap();
684 assert_eq!(actual, expected);
685 }
686
687 // -------------------------------------------------------------------------
688 // Hash Formatting Tests

Callers

nothing calls this directly

Calls 3

unwrapMethod · 0.45
pathMethod · 0.45

Tested by

no test coverage detected