()
| 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() { |
nothing calls this directly
no test coverage detected