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