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

Function test_decode_corrupted_payload

atomic-core/src/change/envelope.rs:778–785  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

776
777 #[test]
778 fn test_decode_corrupted_payload() {
779 let mut bytes = Vec::new();
780 bytes.extend_from_slice(MAGIC);
781 bytes.push(SCHEMA_VERSION);
782 bytes.extend_from_slice(b"this is not valid postcard data at all");
783 let err = SessionEnvelope::decode(&bytes).unwrap_err();
784 assert!(matches!(err, SessionEnvelopeError { .. }));
785 }
786
787 // is_session_envelope
788

Callers

nothing calls this directly

Calls 2

decodeFunction · 0.50
pushMethod · 0.45

Tested by

no test coverage detected