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

Function test_find_repository_root_in_current

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

Source from the content-addressed store, hash-verified

772
773 #[test]
774 fn test_find_repository_root_in_current() {
775 let temp = TempDir::new().unwrap();
776 let _repo = Repository::init(temp.path()).unwrap();
777
778 let result = find_repository_root_from(temp.path());
779 assert!(result.is_ok());
780 // Compare canonical paths to handle macOS /private/var vs /var symlinks
781 let expected = temp
782 .path()
783 .canonicalize()
784 .unwrap_or_else(|_| temp.path().to_path_buf());
785 let actual = result.unwrap();
786 assert_eq!(actual, expected);
787 }
788
789 #[test]
790 fn test_find_repository_root_in_parent() {

Callers

nothing calls this directly

Calls 5

canonicalizeMethod · 0.80
initFunction · 0.50
unwrapMethod · 0.45
pathMethod · 0.45

Tested by

no test coverage detected