From 5d149d631f7736443d5c871a3442bfd99dbaeb48 Mon Sep 17 00:00:00 2001 From: Kerollmops Date: Thu, 30 Jun 2022 15:13:50 +0200 Subject: [PATCH] Remove tests for a function that no more exists --- milli/src/update/index_documents/transform.rs | 85 ------------------- 1 file changed, 85 deletions(-) diff --git a/milli/src/update/index_documents/transform.rs b/milli/src/update/index_documents/transform.rs index a34295a50..6bf3dde43 100644 --- a/milli/src/update/index_documents/transform.rs +++ b/milli/src/update/index_documents/transform.rs @@ -729,88 +729,3 @@ impl TransformOutput { .collect()) } } - -// #[cfg(test)] -// mod test { -// use super::*; - -// mod compute_primary_key { -// use big_s::S; - -// use super::{compute_primary_key_pair, FieldsIdsMap}; - -// #[test] -// fn should_return_primary_key_if_is_some() { -// let mut fields_map = FieldsIdsMap::new(); -// fields_map.insert("toto").unwrap(); -// let result = compute_primary_key_pair( -// Some("toto"), -// &mut fields_map, -// Some("tata".to_string()), -// false, -// ); -// assert_eq!(result.unwrap(), (0, "toto".to_string())); -// assert_eq!(fields_map.len(), 1); - -// // and with nested fields -// let mut fields_map = FieldsIdsMap::new(); -// fields_map.insert("toto.tata").unwrap(); -// let result = compute_primary_key_pair( -// Some("toto.tata"), -// &mut fields_map, -// Some(S("titi")), -// false, -// ); -// assert_eq!(result.unwrap(), (0, "toto.tata".to_string())); -// assert_eq!(fields_map.len(), 1); -// } - -// #[test] -// fn should_return_alternative_if_primary_is_none() { -// let mut fields_map = FieldsIdsMap::new(); -// let result = -// compute_primary_key_pair(None, &mut fields_map, Some("tata".to_string()), false); -// assert_eq!(result.unwrap(), (0, S("tata"))); -// assert_eq!(fields_map.len(), 1); -// } - -// #[test] -// fn should_return_default_if_both_are_none() { -// let mut fields_map = FieldsIdsMap::new(); -// let result = compute_primary_key_pair(None, &mut fields_map, None, true); -// assert_eq!(result.unwrap(), (0, S("id"))); -// assert_eq!(fields_map.len(), 1); -// } - -// #[test] -// fn should_return_err_if_both_are_none_and_recompute_is_false() { -// let mut fields_map = FieldsIdsMap::new(); -// let result = compute_primary_key_pair(None, &mut fields_map, None, false); -// assert!(result.is_err()); -// assert_eq!(fields_map.len(), 0); -// } -// } - -// mod primary_key_inference { -// use big_s::S; -// use bimap::BiHashMap; - -// use crate::documents::DocumentsBatchIndex; -// use crate::update::index_documents::transform::find_primary_key; - -// #[test] -// fn primary_key_infered_on_first_field() { -// // We run the test multiple times to change the order in which the fields are iterated upon. -// for _ in 1..50 { -// let mut map = BiHashMap::new(); -// map.insert(1, S("fakeId")); -// map.insert(2, S("fakeId")); -// map.insert(3, S("fakeId")); -// map.insert(4, S("fakeId")); -// map.insert(0, S("realId")); - -// assert_eq!(find_primary_key(&DocumentsBatchIndex(map)), Some("realId")); -// } -// } -// } -// }