From 271ff5c27c0375165373f4889a07c10d410df51c Mon Sep 17 00:00:00 2001 From: Lucas Jeub Date: Fri, 13 Dec 2024 09:58:18 +0100 Subject: [PATCH] fix search test copy-paste duplication --- raphtory/src/search/mod.rs | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/raphtory/src/search/mod.rs b/raphtory/src/search/mod.rs index c6e1f9a54..df2410ae7 100644 --- a/raphtory/src/search/mod.rs +++ b/raphtory/src/search/mod.rs @@ -33,7 +33,6 @@ use crate::{ }, prelude::*, }; -use itertools::Itertools; use raphtory_api::core::{ entities::GidType, storage::{arc_str::ArcStr, dict_mapper::MaybeNew}, @@ -46,10 +45,10 @@ use tantivy::{ query::QueryParser, schema::{ Field, IndexRecordOption, JsonObjectOptions, Schema, SchemaBuilder, TextFieldIndexing, - TextOptions, Value, FAST, INDEXED, STORED, TEXT, + TextOptions, Value, FAST, INDEXED, STORED, }, tokenizer::{LowerCaser, SimpleTokenizer, TextAnalyzer}, - Document, Index, IndexReader, IndexSettings, IndexWriter, TantivyDocument, TantivyError, + Index, IndexReader, IndexSettings, IndexWriter, TantivyDocument, TantivyError, }; #[derive(Clone)] @@ -885,7 +884,7 @@ mod search_tests { use super::*; use raphtory_api::core::utils::logging::global_info_logger; use std::time::SystemTime; - use tantivy::{doc, DocAddress, Order}; + use tantivy::{doc, schema::TEXT, DocAddress, Order}; use tracing::info; #[test] @@ -1341,12 +1340,6 @@ mod search_tests { g.reload().unwrap(); - let results = g.search_edges("from:Frodo", 5, 0).expect("search failed"); - let actual = results - .into_iter() - .map(|e| (e.src().name(), e.dst().name())) - .collect::>(); - let results = g .search_edges(r#"type:'friends'"#, 10, 0) .expect("search failed"); @@ -1355,7 +1348,6 @@ mod search_tests { .map(|e| (e.src().name(), e.dst().name())) .collect::>(); let expected = vec![("Frodo".to_string(), "Gandalf".to_string())]; - assert_eq!(actual, expected); let results = g @@ -1366,7 +1358,6 @@ mod search_tests { .map(|e| (e.src().name(), e.dst().name())) .collect::>(); let expected = vec![("Frodo".to_string(), "Gollum".to_string())]; - assert_eq!(actual, expected); } @@ -1386,12 +1377,6 @@ mod search_tests { let g: IndexedGraph = g.into(); - let results = g.search_edges("from:Frodo", 5, 0).expect("search failed"); - let actual = results - .into_iter() - .map(|e| (e.src().name(), e.dst().name())) - .collect::>(); - let results = g .search_edges(r#"type:'friends'"#, 10, 0) .expect("search failed");