test db open newness
parent
ce9e552844
commit
0058a9fcdd
|
@ -327,7 +327,20 @@ mod test {
|
|||
|
||||
#[test]
|
||||
fn test_open() {
|
||||
let result = UpEndDatabase::open(TempDir::new("upend-test").unwrap(), None, false);
|
||||
let tempdir = TempDir::new("upend-test").unwrap();
|
||||
|
||||
let result = UpEndDatabase::open(&tempdir, None, false);
|
||||
assert!(result.is_ok());
|
||||
assert!(result.unwrap().new);
|
||||
|
||||
// Not new
|
||||
let result = UpEndDatabase::open(&tempdir, None, false);
|
||||
assert!(result.is_ok());
|
||||
assert!(!result.unwrap().new);
|
||||
|
||||
// reinitialize true, new again
|
||||
let result = UpEndDatabase::open(&tempdir, None, true);
|
||||
assert!(result.is_ok());
|
||||
assert!(result.unwrap().new);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue