()
| 393 | |
| 394 | #[test] |
| 395 | fn test_outcome_add_error() { |
| 396 | let header = ChangeHeader::builder().message("Test").build(); |
| 397 | let change = Change::empty(header); |
| 398 | let hash = Hash::of(b"test"); |
| 399 | let stats = RecordStats::new(); |
| 400 | |
| 401 | let mut outcome = RecordOutcome::new(change, hash, stats); |
| 402 | outcome.add_error("file.rs".to_string(), "read error".to_string()); |
| 403 | |
| 404 | assert!(outcome.has_errors()); |
| 405 | assert_eq!(outcome.errors().len(), 1); |
| 406 | } |
| 407 | |
| 408 | #[test] |
| 409 | fn test_outcome_display() { |