Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Frando committed Aug 16, 2019
1 parent 2328b9f commit 020fc22
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
11 changes: 5 additions & 6 deletions src-rust/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -285,14 +285,12 @@ impl IndexHandle {
};
save_metas(&metas, self.index.directory_mut())?;
} else {
return Err(TantivyError::InvalidArgument(
"segment already indexed".to_string(),
));
return Err(TantivyError::InvalidArgument("Segment exists.".to_string()));
}

if !self.index.searchable_segment_ids()?.contains(&segment_id) {
return Err(TantivyError::InvalidArgument(
"not possible to add segment".to_string(),
"Adding segment failed.".to_string(),
));
}
Ok(())
Expand Down Expand Up @@ -340,8 +338,9 @@ fn move_segment() {
.unwrap();

let handle1 = catalog.get_index(&"testindex1".to_string()).unwrap();
handle1.ensure_writer().unwrap();
let mut writer1 = handle1.writer.take().unwrap();

let writer_lock1 = handle1.get_writer().unwrap();
let mut writer1 = writer_lock1.write().unwrap();

// create a new tantivy Document to push this doc to index1
let mut doc = Document::new();
Expand Down
3 changes: 1 addition & 2 deletions test/segments.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
const test = require('tape')
const { tempdir, copyFiles } = require('./lib/util')
const { getSchema, getDocs, getDocs2 } = require('./lib/fixtures')
const fs = require('fs')

const Sonar = require('..')

test('basic indexing and query', async t => {
test.only('basic indexing and query', async t => {
const [dir, cleanup] = await tempdir()
const catalog = new Sonar(dir)
const schema = getSchema()
Expand Down

0 comments on commit 020fc22

Please sign in to comment.