Skip to content

Commit

Permalink
review
Browse files Browse the repository at this point in the history
  • Loading branch information
toger5 authored and bnjbvr committed Dec 2, 2024
1 parent 12fe46e commit 47ffe32
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions crates/matrix-sdk/src/test_utils/mocks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -874,8 +874,6 @@ impl<'a> MockEndpoint<'a, RoomSendEndpoint> {

/// Ensures that the send endpoint request uses a specific event type.
///
/// Note: works with *any* room.
///
/// # Examples
///
/// see also [`MatrixMockServer::mock_room_send`] for more context.
Expand Down Expand Up @@ -907,7 +905,6 @@ impl<'a> MockEndpoint<'a, RoomSendEndpoint> {
/// // The `m.room.reaction` event type should not be mocked by the server.
/// assert!(responseNotMocked.is_err());
///
///
/// let response = room.send_raw("m.room.message", json!({ "body": "Hello world" })).await?;
/// // The `m.room.message` event type should be mocked by the server.
/// assert_eq!(
Expand Down Expand Up @@ -977,10 +974,11 @@ impl<'a> MockEndpoint<'a, RoomSendStateEndpoint> {
fn generate_path_regex(endpoint: &RoomSendStateEndpoint) -> String {
format!(
r"^/_matrix/client/v3/rooms/.*/state/{}/{}",
endpoint.event_type.as_ref().map(|t| t.to_string()).unwrap_or(".*".to_owned()),
endpoint.state_key.as_ref().map(|k| k.to_string()).unwrap_or(".*".to_owned())
endpoint.event_type.as_ref().map(|t| t.to_string()).unwrap_or_else(|| ".*".to_owned()),
endpoint.state_key.as_ref().map(|k| k.to_string()).unwrap_or_else(|| ".*".to_owned())
)
}

/// Ensures that the body of the request is a superset of the provided
/// `body` parameter.
///
Expand Down

0 comments on commit 47ffe32

Please sign in to comment.