Skip to content

Commit

Permalink
fix search test copy-paste duplication
Browse files Browse the repository at this point in the history
  • Loading branch information
ljeub-pometry committed Dec 13, 2024
1 parent 2e9d831 commit 271ff5c
Showing 1 changed file with 3 additions and 18 deletions.
21 changes: 3 additions & 18 deletions raphtory/src/search/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ use crate::{
},
prelude::*,
};
use itertools::Itertools;
use raphtory_api::core::{
entities::GidType,
storage::{arc_str::ArcStr, dict_mapper::MaybeNew},
Expand All @@ -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)]
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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::<Vec<_>>();

let results = g
.search_edges(r#"type:'friends'"#, 10, 0)
.expect("search failed");
Expand All @@ -1355,7 +1348,6 @@ mod search_tests {
.map(|e| (e.src().name(), e.dst().name()))
.collect::<Vec<_>>();
let expected = vec![("Frodo".to_string(), "Gandalf".to_string())];

assert_eq!(actual, expected);

let results = g
Expand All @@ -1366,7 +1358,6 @@ mod search_tests {
.map(|e| (e.src().name(), e.dst().name()))
.collect::<Vec<_>>();
let expected = vec![("Frodo".to_string(), "Gollum".to_string())];

assert_eq!(actual, expected);
}

Expand All @@ -1386,12 +1377,6 @@ mod search_tests {

let g: IndexedGraph<Graph> = 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::<Vec<_>>();

let results = g
.search_edges(r#"type:'friends'"#, 10, 0)
.expect("search failed");
Expand Down

0 comments on commit 271ff5c

Please sign in to comment.