Skip to content

Commit

Permalink
add some additional test case for Dictionary::term_ord
Browse files Browse the repository at this point in the history
  • Loading branch information
trinity-1686a committed Mar 4, 2023
1 parent 14f9bcc commit 203b260
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions sstable/src/dictionary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,12 @@ mod tests {
slice.restrict(0..0);
assert!(dic.get(b"~~~").unwrap().is_none());
assert!(dic.term_ord(b"~~~").unwrap().is_none());

slice.restrict(0..slice.bytes.len());
// between 1000F and 10010, test case where matched prefix > prefix kept
assert!(dic.term_ord(b"1000G").unwrap().is_none());
// shorter than 10000, tests prefix case
assert!(dic.term_ord(b"1000").unwrap().is_none());
}

#[test]
Expand Down

0 comments on commit 203b260

Please sign in to comment.