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

Function test_decode_unsupported_version

atomic-agent/src/envelope.rs:764–776  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

762
763 #[test]
764 fn test_decode_unsupported_version() {
765 let mut bytes = make_minimal_envelope().encode().unwrap();
766 // Bump version to something unsupported
767 bytes[4] = 99;
768 let err = SessionEnvelope::decode(&bytes).unwrap_err();
769 match err {
770 AgentError::EnvelopeCodecError { reason } => {
771 assert!(reason.contains("unsupported schema version"));
772 assert!(reason.contains("99"));
773 }
774 other => panic!("Expected EnvelopeCodecError, got: {:?}", other),
775 }
776 }
777
778 #[test]
779 fn test_decode_corrupted_payload() {

Callers

nothing calls this directly

Calls 3

make_minimal_envelopeFunction · 0.85
encodeMethod · 0.80
unwrapMethod · 0.45

Tested by

no test coverage detected