()
| 551 | |
| 552 | #[test] |
| 553 | fn test_is_format_error() { |
| 554 | assert!(FormatError::InvalidMagic { got: [0; 4] }.is_format_error()); |
| 555 | assert!(FormatError::UnsupportedVersion { |
| 556 | expected: 1, |
| 557 | got: 2 |
| 558 | } |
| 559 | .is_format_error()); |
| 560 | assert!(FormatError::InvalidHeader { |
| 561 | reason: String::new() |
| 562 | } |
| 563 | .is_format_error()); |
| 564 | assert!(FormatError::InvalidSectionType { type_byte: 0 }.is_format_error()); |
| 565 | assert!(FormatError::UnexpectedSection { |
| 566 | got: String::new(), |
| 567 | expected: String::new(), |
| 568 | } |
| 569 | .is_format_error()); |
| 570 | assert!(FormatError::SectionTruncated { |
| 571 | declared: 0, |
| 572 | actual: 0 |
| 573 | } |
| 574 | .is_format_error()); |
| 575 | assert!(FormatError::UnexpectedEof { expected: 0 }.is_format_error()); |
| 576 | |
| 577 | // Non-format errors |
| 578 | assert!(!FormatError::HashTableFull.is_format_error()); |
| 579 | assert!(!FormatError::Compress(String::new()).is_format_error()); |
| 580 | } |
| 581 | |
| 582 | // ── Suggestions ──────────────────────────────────────────────── |
| 583 |
nothing calls this directly
no outgoing calls
no test coverage detected