ruma-events: Test the key agreement serialization/deserialization.
This commit is contained in:
		
							parent
							
								
									02d7f8d17b
								
							
						
					
					
						commit
						9eb0266cb0
					
				| @ -66,3 +66,18 @@ pub enum VerificationMethod { | ||||
|     #[strum(serialize = "m.sas.v1")] | ||||
|     MSasV1, | ||||
| } | ||||
| 
 | ||||
| #[cfg(test)] | ||||
| mod test { | ||||
|     use super::KeyAgreementProtocol; | ||||
| 
 | ||||
|     #[test] | ||||
|     fn serialize_key_agreement() { | ||||
|         let serialized = | ||||
|             serde_json::to_string(&KeyAgreementProtocol::Curve25519HkdfSha256).unwrap(); | ||||
|         assert_eq!(serialized, "\"curve25519-hkdf-sha256\""); | ||||
| 
 | ||||
|         let deserialized: KeyAgreementProtocol = serde_json::from_str(&serialized).unwrap(); | ||||
|         assert_eq!(deserialized, KeyAgreementProtocol::Curve25519HkdfSha256); | ||||
|     } | ||||
| } | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user