Add tests for borrowed insert

This commit is contained in:
Marcel Müller
2017-10-06 19:37:35 +02:00
parent 5ab6eac583
commit 01d75c293b
+10
View File
@@ -479,6 +479,16 @@ mod test {
assert_eq!(hello, "Hello World!");
}
#[test]
fn simple_insert_and_retrieve_borrow() {
let tmpf = NamedTempFile::new().unwrap();
let db = Database::open(tmpf.path()).unwrap();
db.insert("test", &25).unwrap();
let hello : u32 = db.retrieve("test").unwrap();
assert_eq!(hello, 25);
}
#[test]
fn test_persistence() {
let tmpf = NamedTempFile::new().unwrap();