diff --git a/ruma-client-api/src/r0/message/get_message_events.rs b/ruma-client-api/src/r0/message/get_message_events.rs index 2ea39c74..c8323b84 100644 --- a/ruma-client-api/src/r0/message/get_message_events.rs +++ b/ruma-client-api/src/r0/message/get_message_events.rs @@ -142,7 +142,7 @@ mod tests { use crate::r0::filter::{LazyLoadOptions, RoomEventFilter}; #[test] - fn test_serialize_some_room_event_filter() { + fn serialize_some_room_event_filter() { let room_id = room_id!("!roomid:example.org"); let rooms = &[room_id.clone()]; let filter = RoomEventFilter { @@ -176,7 +176,7 @@ mod tests { } #[test] - fn test_serialize_none_room_event_filter() { + fn serialize_none_room_event_filter() { let room_id = room_id!("!roomid:example.org"); let req = Request { room_id: &room_id, @@ -193,7 +193,7 @@ mod tests { } #[test] - fn test_serialize_default_room_event_filter() { + fn serialize_default_room_event_filter() { let room_id = room_id!("!roomid:example.org"); let req = Request { room_id: &room_id, diff --git a/ruma-client-api/src/r0/tag/get_tags.rs b/ruma-client-api/src/r0/tag/get_tags.rs index f9f76286..5f3b8110 100644 --- a/ruma-client-api/src/r0/tag/get_tags.rs +++ b/ruma-client-api/src/r0/tag/get_tags.rs @@ -57,7 +57,7 @@ mod tests { use super::Response; #[test] - fn test_serializing_get_tags_response() { + fn serializing_get_tags_response() { let mut tags = Tags::new(); tags.insert("m.favourite".into(), assign!(TagInfo::new(), { order: Some(0.25) })); tags.insert("u.user_tag".into(), assign!(TagInfo::new(), { order: Some(0.11) })); diff --git a/ruma-client-api/src/r0/uiaa.rs b/ruma-client-api/src/r0/uiaa.rs index 8a9b9b0c..68cf7177 100644 --- a/ruma-client-api/src/r0/uiaa.rs +++ b/ruma-client-api/src/r0/uiaa.rs @@ -150,7 +150,7 @@ mod tests { use crate::error::{ErrorBody, ErrorKind}; #[test] - fn test_serialize_authentication_data_direct_request() { + fn serialize_authentication_data_direct_request() { let authentication_data = AuthData::DirectRequest { kind: "example.type.foo", session: Some("ZXY000"), @@ -170,7 +170,7 @@ mod tests { } #[test] - fn test_deserialize_authentication_data_direct_request() { + fn deserialize_authentication_data_direct_request() { let json = json!({ "type": "example.type.foo", "session": "opaque_session_id", @@ -189,14 +189,14 @@ mod tests { } #[test] - fn test_serialize_authentication_data_fallback() { + fn serialize_authentication_data_fallback() { let authentication_data = AuthData::FallbackAcknowledgement { session: "ZXY000" }; assert_eq!(json!({ "session": "ZXY000" }), to_json_value(authentication_data).unwrap()); } #[test] - fn test_deserialize_authentication_data_fallback() { + fn deserialize_authentication_data_fallback() { let json = json!({ "session": "opaque_session_id" }); assert_matches!( @@ -207,7 +207,7 @@ mod tests { } #[test] - fn test_serialize_uiaa_info() { + fn serialize_uiaa_info() { let uiaa_info = UiaaInfo { flows: vec![AuthFlow { stages: vec!["m.login.password".into(), "m.login.dummy".into()], @@ -236,7 +236,7 @@ mod tests { } #[test] - fn test_deserialize_uiaa_info() { + fn deserialize_uiaa_info() { let json = json!({ "errcode": "M_FORBIDDEN", "error": "Invalid password", @@ -294,7 +294,7 @@ mod tests { } #[test] - fn test_try_uiaa_response_into_http_response() { + fn try_uiaa_response_into_http_response() { let uiaa_info = UiaaInfo { flows: vec![AuthFlow { stages: vec!["m.login.password".into(), "m.login.dummy".into()], @@ -333,7 +333,7 @@ mod tests { } #[test] - fn test_try_uiaa_response_from_http_response() { + fn try_uiaa_response_from_http_response() { let json = serde_json::to_string(&json!({ "errcode": "M_FORBIDDEN", "error": "Invalid password", diff --git a/ruma-common/src/directory.rs b/ruma-common/src/directory.rs index eb2c1d95..68496346 100644 --- a/ruma-common/src/directory.rs +++ b/ruma-common/src/directory.rs @@ -224,13 +224,13 @@ mod tests { use super::{IncomingRoomNetwork, RoomNetwork}; #[test] - fn test_serialize_matrix_network_only() { + fn serialize_matrix_network_only() { let json = json!({}); assert_eq!(to_json_value(RoomNetwork::Matrix).unwrap(), json); } #[test] - fn test_deserialize_matrix_network_only() { + fn deserialize_matrix_network_only() { let json = json!({ "include_all_networks": false }); assert_eq!( from_json_value::(json).unwrap(), @@ -239,13 +239,13 @@ mod tests { } #[test] - fn test_serialize_default_network_is_empty() { + fn serialize_default_network_is_empty() { let json = json!({}); assert_eq!(to_json_value(RoomNetwork::default()).unwrap(), json); } #[test] - fn test_deserialize_empty_network_is_default() { + fn deserialize_empty_network_is_default() { let json = json!({}); assert_eq!( from_json_value::(json).unwrap(), @@ -254,25 +254,25 @@ mod tests { } #[test] - fn test_serialize_include_all_networks() { + fn serialize_include_all_networks() { let json = json!({ "include_all_networks": true }); assert_eq!(to_json_value(RoomNetwork::All).unwrap(), json); } #[test] - fn test_deserialize_include_all_networks() { + fn deserialize_include_all_networks() { let json = json!({ "include_all_networks": true }); assert_eq!(from_json_value::(json).unwrap(), IncomingRoomNetwork::All); } #[test] - fn test_serialize_third_party_network() { + fn serialize_third_party_network() { let json = json!({ "third_party_instance_id": "freenode" }); assert_eq!(to_json_value(RoomNetwork::ThirdParty("freenode")).unwrap(), json); } #[test] - fn test_deserialize_third_party_network() { + fn deserialize_third_party_network() { let json = json!({ "third_party_instance_id": "freenode" }); assert_eq!( from_json_value::(json).unwrap(), @@ -281,7 +281,7 @@ mod tests { } #[test] - fn test_deserialize_include_all_networks_and_third_party_exclusivity() { + fn deserialize_include_all_networks_and_third_party_exclusivity() { let json = json!({ "include_all_networks": true, "third_party_instance_id": "freenode" }); assert_eq!( from_json_value::(json).unwrap_err().to_string().as_str(), diff --git a/ruma-events/tests/pdu.rs b/ruma-events/tests/pdu.rs index 0beefd74..94cfb9cf 100644 --- a/ruma-events/tests/pdu.rs +++ b/ruma-events/tests/pdu.rs @@ -352,7 +352,7 @@ fn serialize_pdu_as_v3() { } #[test] -fn test_deserialize_pdu_as_v1() { +fn deserialize_pdu_as_v1() { let json = json!({ "room_id": "!n8f893n9:example.com", "event_id": "$somejoinevent:matrix.org", diff --git a/ruma-federation-api/src/serde/v1_pdu.rs b/ruma-federation-api/src/serde/v1_pdu.rs index 8ae765af..0de9699c 100644 --- a/ruma-federation-api/src/serde/v1_pdu.rs +++ b/ruma-federation-api/src/serde/v1_pdu.rs @@ -77,7 +77,7 @@ mod tests { use crate::membership::create_join_event::RoomState; #[test] - fn test_deserialize_response() { + fn deserialize_response() { let response = json!([ 200, { @@ -99,7 +99,7 @@ mod tests { } #[test] - fn test_serialize_response() { + fn serialize_response() { let room_state = RoomState { origin: "matrix.org".into(), auth_chain: Vec::new(), state: Vec::new() }; @@ -120,7 +120,7 @@ mod tests { } #[test] - fn test_too_short_array() { + fn too_short_array() { let json = json!([200]); let failed_room_state = deserialize::(json); assert_eq!( @@ -130,7 +130,7 @@ mod tests { } #[test] - fn test_not_an_array() { + fn not_an_array() { let json = json!({ "origin": "matrix.org", "auth_chain": [], @@ -145,7 +145,7 @@ mod tests { } #[test] - fn test_too_long_array() { + fn too_long_array() { let json = json!([200, {"origin": "", "auth_chain": [], "state": []}, 200]); assert_matches!( deserialize(json).unwrap(), diff --git a/ruma-serde/src/duration/opt_ms.rs b/ruma-serde/src/duration/opt_ms.rs index 16b538f0..567d0b6b 100644 --- a/ruma-serde/src/duration/opt_ms.rs +++ b/ruma-serde/src/duration/opt_ms.rs @@ -54,7 +54,7 @@ mod tests { } #[test] - fn test_deserialize_some() { + fn deserialize_some() { let json = json!({ "timeout": 3000 }); assert_eq!( @@ -64,7 +64,7 @@ mod tests { } #[test] - fn test_deserialize_none_by_absence() { + fn deserialize_none_by_absence() { let json = json!({}); assert_eq!( @@ -74,7 +74,7 @@ mod tests { } #[test] - fn test_deserialize_none_by_null() { + fn deserialize_none_by_null() { let json = json!({ "timeout": null }); assert_eq!( @@ -84,13 +84,13 @@ mod tests { } #[test] - fn test_serialize_some() { + fn serialize_some() { let request = DurationTest { timeout: Some(Duration::new(2, 0)) }; assert_eq!(serde_json::to_value(&request).unwrap(), json!({ "timeout": 2000 })); } #[test] - fn test_serialize_none() { + fn serialize_none() { let request = DurationTest { timeout: None }; assert_eq!(serde_json::to_value(&request).unwrap(), json!({})); } diff --git a/ruma-serde/src/duration/secs.rs b/ruma-serde/src/duration/secs.rs index 4935d154..9ac56622 100644 --- a/ruma-serde/src/duration/secs.rs +++ b/ruma-serde/src/duration/secs.rs @@ -50,7 +50,7 @@ mod tests { } #[test] - fn test_deserialize() { + fn deserialize() { let json = json!({ "timeout": 3 }); assert_eq!( @@ -60,7 +60,7 @@ mod tests { } #[test] - fn test_serialize() { + fn serialize() { let test = DurationTest { timeout: Duration::from_millis(7000) }; assert_eq!(serde_json::to_value(test).unwrap(), json!({ "timeout": 7 })); } diff --git a/ruma-serde/src/time/ms_since_unix_epoch.rs b/ruma-serde/src/time/ms_since_unix_epoch.rs index f108e0dd..6abb8fcb 100644 --- a/ruma-serde/src/time/ms_since_unix_epoch.rs +++ b/ruma-serde/src/time/ms_since_unix_epoch.rs @@ -54,7 +54,7 @@ mod tests { } #[test] - fn test_deserialize() { + fn deserialize() { let json = json!({ "timestamp": 3000 }); assert_eq!( @@ -64,7 +64,7 @@ mod tests { } #[test] - fn test_serialize() { + fn serialize() { let request = SystemTimeTest { timestamp: UNIX_EPOCH + Duration::new(2, 0) }; assert_eq!(serde_json::to_value(&request).unwrap(), json!({ "timestamp": 2000 })); } diff --git a/ruma-serde/src/time/opt_ms_since_unix_epoch.rs b/ruma-serde/src/time/opt_ms_since_unix_epoch.rs index d8d68b62..100b84c9 100644 --- a/ruma-serde/src/time/opt_ms_since_unix_epoch.rs +++ b/ruma-serde/src/time/opt_ms_since_unix_epoch.rs @@ -50,7 +50,7 @@ mod tests { } #[test] - fn test_deserialize_some() { + fn deserialize_some() { let json = json!({ "timestamp": 3000 }); assert_eq!( @@ -60,7 +60,7 @@ mod tests { } #[test] - fn test_deserialize_none_by_absence() { + fn deserialize_none_by_absence() { let json = json!({}); assert_eq!( @@ -70,7 +70,7 @@ mod tests { } #[test] - fn test_deserialize_none_by_null() { + fn deserialize_none_by_null() { let json = json!({ "timestamp": null }); assert_eq!( @@ -80,13 +80,13 @@ mod tests { } #[test] - fn test_serialize_some() { + fn serialize_some() { let request = SystemTimeTest { timestamp: Some(UNIX_EPOCH + Duration::new(2, 0)) }; assert_eq!(serde_json::to_value(&request).unwrap(), json!({ "timestamp": 2000 })); } #[test] - fn test_serialize_none() { + fn serialize_none() { let request = SystemTimeTest { timestamp: None }; assert_eq!(serde_json::to_value(&request).unwrap(), json!({})); } diff --git a/ruma-serde/src/time/opt_s_since_unix_epoch.rs b/ruma-serde/src/time/opt_s_since_unix_epoch.rs index a922e9ea..b7711b62 100644 --- a/ruma-serde/src/time/opt_s_since_unix_epoch.rs +++ b/ruma-serde/src/time/opt_s_since_unix_epoch.rs @@ -50,7 +50,7 @@ mod tests { } #[test] - fn test_deserialize_some() { + fn deserialize_some() { let json = json!({ "timestamp": 3000 }); assert_eq!( @@ -60,7 +60,7 @@ mod tests { } #[test] - fn test_deserialize_none_by_absence() { + fn deserialize_none_by_absence() { let json = json!({}); assert_eq!( @@ -70,7 +70,7 @@ mod tests { } #[test] - fn test_deserialize_none_by_null() { + fn deserialize_none_by_null() { let json = json!({ "timestamp": null }); assert_eq!( @@ -80,13 +80,13 @@ mod tests { } #[test] - fn test_serialize_some() { + fn serialize_some() { let request = SystemTimeTest { timestamp: Some(UNIX_EPOCH + Duration::new(2000, 0)) }; assert_eq!(serde_json::to_value(&request).unwrap(), json!({ "timestamp": 2000 })); } #[test] - fn test_serialize_none() { + fn serialize_none() { let request = SystemTimeTest { timestamp: None }; assert_eq!(serde_json::to_value(&request).unwrap(), json!({})); } diff --git a/ruma-serde/src/time/s_since_unix_epoch.rs b/ruma-serde/src/time/s_since_unix_epoch.rs index 94335814..75c43acd 100644 --- a/ruma-serde/src/time/s_since_unix_epoch.rs +++ b/ruma-serde/src/time/s_since_unix_epoch.rs @@ -54,7 +54,7 @@ mod tests { } #[test] - fn test_deserialize() { + fn deserialize() { let json = json!({ "timestamp": 3000 }); assert_eq!( @@ -64,7 +64,7 @@ mod tests { } #[test] - fn test_serialize() { + fn serialize() { let request = SystemTimeTest { timestamp: UNIX_EPOCH + Duration::new(2000, 0) }; assert_eq!(serde_json::to_value(&request).unwrap(), json!({ "timestamp": 2000 })); }