aboutsummaryrefslogtreecommitdiff
path: root/src/db/test.rs
diff options
context:
space:
mode:
authorAlex <alex@adnab.me>2022-10-18 14:16:52 +0000
committerAlex <alex@adnab.me>2022-10-18 14:16:52 +0000
commit7bc9fd34b250384d1b80ed28dc6c9e6abcda69ae (patch)
tree2aa704a85ec0fe7ef8e28daaa1c71fd449be1453 /src/db/test.rs
parent4582a8f34aba85ff7b0a56935f27cc166819dec1 (diff)
parenta54a63c491556b746dab02a0766034af70c61457 (diff)
downloadgarage-7bc9fd34b250384d1b80ed28dc6c9e6abcda69ae.tar.gz
garage-7bc9fd34b250384d1b80ed28dc6c9e6abcda69ae.zip
Merge pull request 'upgrade Nix toolchain' (#400) from upgrade-toolchain into main
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/400
Diffstat (limited to 'src/db/test.rs')
-rw-r--r--src/db/test.rs13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/db/test.rs b/src/db/test.rs
index cfcee643..40e6c41e 100644
--- a/src/db/test.rs
+++ b/src/db/test.rs
@@ -1,9 +1,5 @@
use crate::*;
-use crate::lmdb_adapter::LmdbDb;
-use crate::sled_adapter::SledDb;
-use crate::sqlite_adapter::SqliteDb;
-
fn test_suite(db: Db) {
let tree = db.open_tree("tree").unwrap();
@@ -80,7 +76,10 @@ fn test_suite(db: Db) {
}
#[test]
+#[cfg(feature = "lmdb")]
fn test_lmdb_db() {
+ use crate::lmdb_adapter::LmdbDb;
+
let path = mktemp::Temp::new_dir().unwrap();
let db = heed::EnvOpenOptions::new()
.max_dbs(100)
@@ -92,7 +91,10 @@ fn test_lmdb_db() {
}
#[test]
+#[cfg(feature = "sled")]
fn test_sled_db() {
+ use crate::sled_adapter::SledDb;
+
let path = mktemp::Temp::new_dir().unwrap();
let db = SledDb::init(sled::open(path.to_path_buf()).unwrap());
test_suite(db);
@@ -100,7 +102,10 @@ fn test_sled_db() {
}
#[test]
+#[cfg(feature = "sqlite")]
fn test_sqlite_db() {
+ use crate::sqlite_adapter::SqliteDb;
+
let db = SqliteDb::init(rusqlite::Connection::open_in_memory().unwrap());
test_suite(db);
}