about summary refs log tree commit diff
path: root/tests/search_native.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/search_native.rs')
-rw-r--r--tests/search_native.rs18
1 files changed, 9 insertions, 9 deletions
diff --git a/tests/search_native.rs b/tests/search_native.rs
index 6c8f58e..3b75687 100644
--- a/tests/search_native.rs
+++ b/tests/search_native.rs
@@ -14,7 +14,7 @@
 //! development index is never a recorded-count source, per
 //! AMENDMENT B — counts are printed as reference data only).
 
-use genenetwork4::search::{self as seam, Engine, SearchError, SearchHit, native::Native};
+use genenetwork4::search::{self as seam, Engine, SearchError, SearchHit, gnindex::CrateEngine};
 
 /// The name of a result's variant, so a failed assertion can name what
 /// it got without requiring `SearchHit: Debug`.
@@ -47,7 +47,7 @@ async fn native_engine_error_contract_and_per_page_invariant() {
     //    carries the parser's own classification.
     set("XAPIAN_DB_PATH", "");
     set("SEARCH_ENGINE", "native");
-    let result = Native.search("alcohol AND", "phenotype", 5, 1).await;
+    let result = CrateEngine::from_config().search("alcohol AND", "phenotype", 5, 1).await;
     assert_eq!(variant_name(&result), "InvalidQuery");
     let Err(SearchError::InvalidQuery {
         message,
@@ -65,12 +65,12 @@ async fn native_engine_error_contract_and_per_page_invariant() {
     assert_eq!(variant_name(&result), "InvalidQuery");
 
     // 3. An unset index path is a local misconfiguration: Internal.
-    let result = Native.search("alcohol", "phenotype", 5, 1).await;
+    let result = CrateEngine::from_config().search("alcohol", "phenotype", 5, 1).await;
     assert_eq!(variant_name(&result), "Internal");
 
     // 4. An index path that cannot be opened: Unreachable.
     set("XAPIAN_DB_PATH", "/nonexistent/gn4-native-test-index");
-    let result = Native.search("alcohol", "phenotype", 5, 1).await;
+    let result = CrateEngine::from_config().search("alcohol", "phenotype", 5, 1).await;
     assert_eq!(variant_name(&result), "Unreachable");
 
     // 5. The default engine stays the gn3 forwarder: with
@@ -110,13 +110,13 @@ async fn native_engine_error_contract_and_per_page_invariant() {
     // Forward limit=10: the engine must ignore it and return the FULL
     // match set (PORT-DESIGN §5 — the recording compared complete
     // match sets; Q02's is 57 632 hits).
-    let small = Native.search("alcohol", "phenotype", 10, 1).await;
+    let small = CrateEngine::from_config().search("alcohol", "phenotype", 10, 1).await;
     let small = match small {
         Ok(hits) => hits,
         Err(e) => panic!("dev-index search failed: {e:?}"),
     };
     // ... and the same query at a different limit returns the same set.
-    let large = Native
+    let large = CrateEngine::from_config()
         .search("alcohol", "phenotype", 100, 1)
         .await
         .expect("dev-index search with limit=100");
@@ -151,7 +151,7 @@ async fn native_engine_error_contract_and_per_page_invariant() {
     // 7. The typed search hits decode through the doc-data mapping:
     //    a typed query through a type the index documents (gene) must
     //    also come back Ok (the XT filter maps to real XT terms).
-    let genes = Native
+    let genes = CrateEngine::from_config()
         .search("insulin", "gene", 20, 1)
         .await
         .expect("dev-index insulin/gene search");
@@ -175,7 +175,7 @@ async fn native_engine_error_contract_and_per_page_invariant() {
             h.name.clone().unwrap_or_default(),
         )
     };
-    let page2 = Native
+    let page2 = CrateEngine::from_config()
         .search("alcohol", "phenotype", 10, 2)
         .await
         .expect("dev-index page-2 search");
@@ -195,7 +195,7 @@ async fn native_engine_error_contract_and_per_page_invariant() {
         page2.iter().all(|h| !head.contains(&hit_key(h))),
         "page 1 and page 2 must be disjoint"
     );
-    let far = Native
+    let far = CrateEngine::from_config()
         .search("alcohol", "phenotype", 10, 100_000)
         .await
         .expect("dev-index far-page search");