()
| 613 | |
| 614 | #[test] |
| 615 | fn test_find_repository_root_not_found() { |
| 616 | let temp = TempDir::new().unwrap(); |
| 617 | |
| 618 | // On some CI environments (especially Windows), a .atomic directory |
| 619 | // may exist somewhere above the temp dir in the filesystem hierarchy. |
| 620 | // Verify the precondition before asserting, and skip gracefully if not met. |
| 621 | let has_atomic_ancestor = { |
| 622 | let mut check = temp.path().to_path_buf(); |
| 623 | let mut found = false; |
| 624 | loop { |
| 625 | if check.join(DOT_DIR).is_dir() { |
| 626 | found = true; |
| 627 | break; |
| 628 | } |
| 629 | if !check.pop() { |
| 630 | break; |
| 631 | } |
| 632 | } |
| 633 | found |
| 634 | }; |
| 635 | if has_atomic_ancestor { |
| 636 | // A real .atomic dir exists above the temp dir; this test cannot |
| 637 | // reliably assert "not found" in this environment — skip it. |
| 638 | return; |
| 639 | } |
| 640 | |
| 641 | let result = find_repository_root_from(temp.path()); |
| 642 | assert!(result.is_err()); |
| 643 | assert!(matches!( |
| 644 | result.unwrap_err(), |
| 645 | CliError::RepositoryNotFound { .. } |
| 646 | )); |
| 647 | } |
| 648 | |
| 649 | #[test] |
| 650 | fn test_find_repository_root_in_current() { |
nothing calls this directly
no test coverage detected