Skip to content

Commit

Permalink
include metadata in test
Browse files Browse the repository at this point in the history
  • Loading branch information
maxcountryman committed Mar 9, 2024
1 parent eb1c36e commit 3c63da5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ mod tests {
async fn root(messages: Messages) -> impl IntoResponse {
messages
.into_iter()
.map(|message| format!("{}: {}", message.level, message))
.map(|message| format!("{}: {} {:?}", message.level, message, message.metadata))
.collect::<Vec<_>>()
.join(", ")
}
Expand Down Expand Up @@ -440,6 +440,10 @@ mod tests {

let bytes = response.into_body().collect().await.unwrap().to_bytes();
let body = String::from_utf8(bytes.to_vec()).unwrap();
assert_eq!(body, "Debug: Hello, world!, Info: This is an info message.");
assert_eq!(
body,
"Debug: Hello, world! Some({\"foo\": String(\"bar\")}), Info: This is an info \
message. None"
);
}
}

0 comments on commit 3c63da5

Please sign in to comment.