diff --git a/Cargo.lock b/Cargo.lock index 02e5639e7..2834d50c3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2363,12 +2363,14 @@ dependencies = [ "actix-web", "csv", "either", + "insta", + "meili-snap", "milli 0.33.4", "proptest", "proptest-derive", "serde", "serde_json", - "time 0.3.14", + "time", "tokio", "uuid 1.1.2", ] diff --git a/meilisearch-types/Cargo.toml b/meilisearch-types/Cargo.toml index 4e068b903..05691e49b 100644 --- a/meilisearch-types/Cargo.toml +++ b/meilisearch-types/Cargo.toml @@ -20,6 +20,8 @@ uuid = { version = "1.1.2", features = ["serde", "v4"] } [dev-dependencies] proptest = "1.0.0" proptest-derive = "0.3.0" +meili-snap = { path = "../meili-snap" } +insta = "1.19.1" [features] default = ["milli/default"] diff --git a/meilisearch-types/src/tasks.rs b/meilisearch-types/src/tasks.rs index dd8b94684..61e1f51d0 100644 --- a/meilisearch-types/src/tasks.rs +++ b/meilisearch-types/src/tasks.rs @@ -365,10 +365,8 @@ pub fn serialize_duration( } } -/* #[cfg(test)] mod tests { - use crate::assert_smol_debug_snapshot; use crate::heed::{types::SerdeJson, BytesDecode, BytesEncode}; use super::Details; @@ -382,8 +380,7 @@ mod tests { }; let serialised = SerdeJson::
::bytes_encode(&details).unwrap(); let deserialised = SerdeJson::
::bytes_decode(&serialised).unwrap(); - assert_smol_debug_snapshot!(details, @r###"DeleteTasks { matched_tasks: 1, deleted_tasks: None, original_query: "hello" }"###); - assert_smol_debug_snapshot!(deserialised, @r###"DeleteTasks { matched_tasks: 1, deleted_tasks: None, original_query: "hello" }"###); + meili_snap::snapshot!(format!("{:?}", details), @r###"DeleteTasks { matched_tasks: 1, deleted_tasks: None, original_query: "hello" }"###); + meili_snap::snapshot!(format!("{:?}", deserialised), @r###"DeleteTasks { matched_tasks: 1, deleted_tasks: None, original_query: "hello" }"###); } } -*/