MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / test_is_format_error

Function test_is_format_error

atomic-core/src/change/format_v3/error.rs:553–580  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected