split adding and dropping columns tests

This commit is contained in:
Robert Habermeier 2017-02-27 18:57:22 +01:00
parent 868624c6a9
commit da3c13f0a2

View File

@ -929,7 +929,7 @@ mod tests {
}
#[test]
fn dynamic_add_drop_columns() {
fn add_columns() {
let config = DatabaseConfig::default();
let config_5 = DatabaseConfig::with_columns(Some(5));
@ -946,6 +946,20 @@ mod tests {
}
}
// reopen as 5.
{
let db = Database::open(&config_5, path.as_path().to_str().unwrap()).unwrap();
assert_eq!(db.num_columns(), 5);
}
}
#[test]
fn drop_columns() {
let config = DatabaseConfig::default();
let config_5 = DatabaseConfig::with_columns(Some(5));
let path = RandomTempPath::create_dir();
// open 5, remove all.
{
let db = Database::open(&config_5, path.as_path().to_str().unwrap()).unwrap();