()
| 646 | |
| 647 | #[test] |
| 648 | fn test_find_repository_root_in_current() { |
| 649 | let temp = TempDir::new().unwrap(); |
| 650 | std::fs::create_dir(temp.path().join(DOT_DIR)).unwrap(); |
| 651 | |
| 652 | let result = find_repository_root_from(temp.path()); |
| 653 | assert!(result.is_ok()); |
| 654 | // Compare canonical paths to handle macOS /private/var vs /var symlinks |
| 655 | let expected = temp |
| 656 | .path() |
| 657 | .canonicalize() |
| 658 | .unwrap_or_else(|_| temp.path().to_path_buf()); |
| 659 | let actual = result.unwrap(); |
| 660 | assert_eq!(actual, expected); |
| 661 | } |
| 662 | |
| 663 | #[test] |
| 664 | fn test_find_repository_root_in_parent() { |
nothing calls this directly
no test coverage detected