From 99889a0ed08ccb0d9d27cbfd57fce712f2e70816 Mon Sep 17 00:00:00 2001 From: mpostma Date: Mon, 11 Oct 2021 15:03:52 +0200 Subject: [PATCH] add obkv document serialization test --- milli/src/documents/mod.rs | 8 ++++++++ milli/src/update/settings.rs | 1 - 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/milli/src/documents/mod.rs b/milli/src/documents/mod.rs index da4227e6b..f79c210fe 100644 --- a/milli/src/documents/mod.rs +++ b/milli/src/documents/mod.rs @@ -230,4 +230,12 @@ mod test { let nested: Value = serde_json::from_slice(doc.get(0).unwrap()).unwrap(); assert_eq!(nested, json!({ "toto": ["hello"] })); } + + #[test] + fn out_of_order_fields() { + let _documents = documents!([ + {"id": 1,"b": 0}, + {"id": 2,"a": 0,"b": 0}, + ]); + } } diff --git a/milli/src/update/settings.rs b/milli/src/update/settings.rs index 87a829a1a..4aa79f6e3 100644 --- a/milli/src/update/settings.rs +++ b/milli/src/update/settings.rs @@ -1134,7 +1134,6 @@ mod tests { "release_date": 819676800 } ]); - let builder = IndexDocuments::new(&mut wtxn, &index, 1); builder.execute(content, |_, _| ()).unwrap(); wtxn.commit().unwrap();