Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
zaidoon1 committed Mar 20, 2024
1 parent 88d60b6 commit 3cf28ad
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/test_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1626,4 +1626,26 @@ fn set_stderr_logger_test() {
db.put(b"k4", b"v4").unwrap();
db.put(b"k5", b"v5").unwrap();
}

{
let mut opts = Options::default();
opts.create_if_missing(true);
opts.create_missing_column_families(true);
opts.set_stderr_logger(rust_rocksdb::LogLevel::Info, None::<&str>);

let cfs = vec!["cf1"];
let db = DB::open_cf(&opts, &path, cfs).unwrap();
let cf1 = db.cf_handle("cf1").unwrap();
db.put_cf(&cf1, b"k1", b"v1").unwrap();
db.put_cf(&cf1, b"k2", b"v2").unwrap();
db.put_cf(&cf1, b"k3", b"v3").unwrap();
db.put_cf(&cf1, b"k4", b"v4").unwrap();
db.put_cf(&cf1, b"k5", b"v5").unwrap();

db.put(b"k1", b"v1").unwrap();
db.put(b"k2", b"v2").unwrap();
db.put(b"k3", b"v3").unwrap();
db.put(b"k4", b"v4").unwrap();
db.put(b"k5", b"v5").unwrap();
}
}

0 comments on commit 3cf28ad

Please sign in to comment.