diff --git a/tests/test_column_family.rs b/tests/test_column_family.rs index 8644aaa..82eccc3 100644 --- a/tests/test_column_family.rs +++ b/tests/test_column_family.rs @@ -80,6 +80,25 @@ pub fn test_column_family() { assert!(DB::destroy(&Options::default(), path).is_ok()); } +#[test] +fn test_create_missing_column_family() { + let path = "_rust_rocksdb_missing_cftest"; + + // should be able to create new column families when opening a new database + { + let mut opts = Options::default(); + opts.create_if_missing(true); + opts.create_missing_column_families(true); + + match DB::open_cf(&opts, path, &["cf1"]) { + Ok(_) => println!("successfully created new column family"), + Err(e) => panic!("failed to create new column family: {}", e), + } + } + + assert!(DB::destroy(&Options::default(), path).is_ok()); +} + #[test] #[ignore] fn test_merge_operator() {