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