Add more tests

master
Martin Ek 6 years ago
parent 3a069ff4dc
commit 7b38b29d8c
  1. 34
      tests/test_property.rs

@ -24,16 +24,46 @@ fn property_test() {
{
let db = DB::open_default(&n).unwrap();
let value = db
.property_int_value("rocksdb.estimate-live-data-size")
.property_value("rocksdb.stats")
.unwrap()
.unwrap();
assert!(value == Some(0));
assert!(value.contains("Stats"));
}
}
#[test]
fn property_cf_test() {
let n = DBPath::new("_rust_rocksdb_property_cf_test");
{
let opts = Options::default();
let db = DB::open_default(&n).unwrap();
let cf = db.create_cf("cf1", &opts).unwrap();
let value = db
.property_value_cf(cf, "rocksdb.stats")
.unwrap()
.unwrap();
assert!(value.contains("Stats"));
}
}
#[test]
fn property_int_test() {
let n = DBPath::new("_rust_rocksdb_property_int_test");
{
let db = DB::open_default(&n).unwrap();
let value = db
.property_int_value("rocksdb.estimate-live-data-size")
.unwrap();
assert!(value == Some(0));
}
}
#[test]
fn property_int_cf_test() {
let n = DBPath::new("_rust_rocksdb_property_int_cf_test");
{
let opts = Options::default();
let db = DB::open_default(&n).unwrap();

Loading…
Cancel
Save