Remove tests for a function that no more exists

This commit is contained in:
Kerollmops 2022-06-30 15:13:50 +02:00
parent 0bbcc7b180
commit 5d149d631f
No known key found for this signature in database
GPG Key ID: 92ADA4E935E71FA4

View File

@ -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"));
// }
// }
// }
// }