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