From 7b38b29d8cca393616fc5ba71a075c7e76969c66 Mon Sep 17 00:00:00 2001 From: Martin Ek Date: Sun, 10 Feb 2019 17:33:44 +0000 Subject: [PATCH] Add more tests --- tests/test_property.rs | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/tests/test_property.rs b/tests/test_property.rs index c2be439..11e1f21 100644 --- a/tests/test_property.rs +++ b/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();