| 1001 | |
| 1002 | #[test] |
| 1003 | fn test_repository_status_get() { |
| 1004 | let mut status = RepositoryStatus::new("dev".to_string(), None); |
| 1005 | |
| 1006 | status.add_entry(FileStatusEntry::new( |
| 1007 | PathBuf::from("src/main.rs"), |
| 1008 | FileStatus::Modified, |
| 1009 | )); |
| 1010 | |
| 1011 | let entry = status.get(Path::new("src/main.rs")); |
| 1012 | assert!(entry.is_some()); |
| 1013 | assert_eq!(entry.unwrap().status(), FileStatus::Modified); |
| 1014 | |
| 1015 | let missing = status.get(Path::new("nonexistent.rs")); |
| 1016 | assert!(missing.is_none()); |
| 1017 | } |
| 1018 | |
| 1019 | #[test] |
| 1020 | fn test_repository_status_filters() { |