},
);
}
#[test]
fn old_schema_gives_correct_error() {
let tempdir = {
let context = Context::builder().build();
let wtx = context.index.database.begin_write().unwrap();
wtx
.open_table(STATISTIC_TO_COUNT)
.unwrap()
.insert(&Statistic::Schema.key(), &0)
.unwrap();
wtx.commit().unwrap();
context.tempdir
};
let path = tempdir.path().to_owned();
let delimiter = if cfg!(windows) { '\\' } else { '/' };
assert_eq!(
Context::builder().tempdir(tempdir).try_build().err().unwrap().to_string(),
format!("index at `{}{delimiter}regtest{delimiter}index.redb` appears to have been built with an older, incompatible version of ord, consider deleting and rebuilding the index: index schema 0, ord schema {SCHEMA_VERSION}", path.display()));
}
#[test]
fn new_schema_gives_correct_error() {
let tempdir = {
let context = Context::builder().build();
let wtx = context.index.database.begin_write().unwrap();