added tests for correct handling of lockfiles

This commit is contained in:
Michael J. Curry
2016-10-02 21:32:49 -04:00
parent d580b8a5ac
commit bb42606a9b

View File

@@ -310,6 +310,28 @@ mod tests {
use Index;
use Term;
#[test]
#[should_panic]
fn test_lockfile_stops_duplicates() {
let mut schema_builder = schema::SchemaBuilder::default();
let text_field = schema_builder.add_text_field("text", schema::TEXT);
let index = Index::create_in_ram(schema_builder.build());
let index_writer = index.writer(40_000_000).unwrap();
let index_writer_two = index.writer(40_000_000).unwrap();
}
#[test]
fn test_lockfile_released_on_drop() {
let mut schema_builder = schema::SchemaBuilder::default();
let text_field = schema_builder.add_text_field("text", schema::TEXT);
let index = Index::create_in_ram(schema_builder.build());
{
let index_writer = index.writer(40_000_000).unwrap();
}
let index_writer_two = index.writer(40_000_000).unwrap();
}
#[test]
fn test_commit_and_rollback() {
let mut schema_builder = schema::SchemaBuilder::default();