pretty_eq

This commit is contained in:
Adil Hafeez 2024-10-22 12:42:44 -07:00
parent e218f875d7
commit ffe6193a6e
3 changed files with 5 additions and 0 deletions

1
crates/Cargo.lock generated
View file

@ -1120,6 +1120,7 @@ dependencies = [
"http", "http",
"log", "log",
"md5", "md5",
"pretty_assertions",
"proxy-wasm", "proxy-wasm",
"proxy-wasm-test-framework", "proxy-wasm-test-framework",
"rand", "rand",

View file

@ -26,3 +26,4 @@ sha2 = "0.10.8"
[dev-dependencies] [dev-dependencies]
proxy-wasm-test-framework = { git = "https://github.com/katanemo/test-framework.git", branch = "new" } proxy-wasm-test-framework = { git = "https://github.com/katanemo/test-framework.git", branch = "new" }
serial_test = "3.1.1" serial_test = "3.1.1"
pretty_assertions = "1.4.1"

View file

@ -40,6 +40,7 @@ pub fn extract_messages_for_hallucination(messages: &Vec<Message>) -> Vec<String
#[cfg(test)] #[cfg(test)]
mod test { mod test {
use pretty_assertions::assert_eq;
use common::common_types::open_ai::Message; use common::common_types::open_ai::Message;
use super::extract_messages_for_hallucination; use super::extract_messages_for_hallucination;
@ -157,5 +158,7 @@ mod test {
let messages_for_halluncination = extract_messages_for_hallucination(&messages); let messages_for_halluncination = extract_messages_for_hallucination(&messages);
println!("{:?}", messages_for_halluncination); println!("{:?}", messages_for_halluncination);
assert_eq!(messages_for_halluncination.len(), 3); assert_eq!(messages_for_halluncination.len(), 3);
assert_eq!(["tell me about the weather", "Seattle", "7 days"], messages_for_halluncination.as_slice());
} }
} }