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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

unwrapMethod · 0.45
pathMethod · 0.45

Tested by

no test coverage detected