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

Source from the content-addressed store, hash-verified

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