()
| 751 | |
| 752 | #[test] |
| 753 | fn test_decode_wrong_magic() { |
| 754 | let err = SessionEnvelope::decode(b"XXXXmore data here").unwrap_err(); |
| 755 | match err { |
| 756 | AgentError::EnvelopeCodecError { reason } => { |
| 757 | assert!(reason.contains("invalid magic")); |
| 758 | } |
| 759 | other => panic!("Expected EnvelopeCodecError, got: {:?}", other), |
| 760 | } |
| 761 | } |
| 762 | |
| 763 | #[test] |
| 764 | fn test_decode_unsupported_version() { |