forked from skade/leveldb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmanagement.rs
34 lines (31 loc) · 931 Bytes
/
management.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
use leveldb::management::*;
use leveldb::options::*;
use utils::{open_database,tmpdir};
#[test]
fn test_destroy_database() {
let tmp = tmpdir("destroy");
let database = open_database::<i32>(tmp.path(), true);
drop(database);
let options = Options::new();
let res = destroy(tmp.path(), options);
assert!(res.is_ok());
}
#[test]
fn test_repair_database() {
let tmp = tmpdir("repair");
let database = open_database::<i32>(tmp.path(), true);
drop(database);
let options = Options::new();
let res = repair(tmp.path(), options);
assert!(res.is_ok());
}
// Deactivated due do library version dependence
//#[test]
//fn test_destroy_open_database() {
// let tmp = tmpdir("destroy_open");
// let database = open_database::<i32>(tmp.path(), true);
// let options = Options::new();
// let res = destroy(tmp.path(), options);
// assert!(res.is_err());
// drop(database);
//}