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:674–690  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

unwrapMethod · 0.45
pathMethod · 0.45

Tested by

no test coverage detected