()
| 655 | |
| 656 | #[test] |
| 657 | fn test_find_repository_root_in_current() { |
| 658 | let temp = TempDir::new().unwrap(); |
| 659 | std::fs::create_dir(temp.path().join(DOT_DIR)).unwrap(); |
| 660 | |
| 661 | let result = find_repository_root_from(temp.path()); |
| 662 | assert!(result.is_ok()); |
| 663 | // Compare canonical paths to handle macOS /private/var vs /var symlinks |
| 664 | let expected = temp |
| 665 | .path() |
| 666 | .canonicalize() |
| 667 | .unwrap_or_else(|_| temp.path().to_path_buf()); |
| 668 | let actual = result.unwrap(); |
| 669 | assert_eq!(actual, expected); |
| 670 | } |
| 671 | |
| 672 | #[test] |
| 673 | fn test_find_repository_root_in_parent() { |
nothing calls this directly
no test coverage detected