Cesar Rodas 3 mēneši atpakaļ
vecāks
revīzija
6aff308dd5
1 mainītis faili ar 11 papildinājumiem un 8 dzēšanām
  1. 11 8
      crates/storage/rocksdb/src/lib.rs

+ 11 - 8
crates/storage/rocksdb/src/lib.rs

@@ -293,13 +293,16 @@ impl Storage for RocksDb {
 }
 
 #[cfg(test)]
-async fn new_instance(path: &str) -> RocksDb {
-    RocksDb::new(path).expect("valid db")
-}
+mod test {
+    use super::*;
 
-#[cfg(test)]
-async fn destroy_instance(path: &str) {
-    std::fs::remove_dir_all(path).expect("deleted file");
-}
+    async fn new_instance(path: &str) -> RocksDb {
+        RocksDb::new(path).expect("valid db")
+    }
 
-nostr_rs_storage_base::storage_test!(RocksDb, new_instance, destroy_instance);
+    async fn destroy_instance(path: &str) {
+        std::fs::remove_dir_all(path).expect("deleted file");
+    }
+
+    nostr_rs_storage_base::storage_test!(RocksDb, new_instance, destroy_instance);
+}