Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
a10y committed Aug 15, 2024
1 parent 3bfff50 commit 489537f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/lossy_pht.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use crate::MAX_CODE;
/// vendors split the L1 cache into 32KB of instruction and 32KB of data.
pub const HASH_TABLE_SIZE: usize = 1 << 11;

/// A single entry in the [`SymbolTable`].
/// A single entry in the [Lossy Perfect Hash Table][`LossyPHT`].
///
/// `TableEntry` is based on the `Symbol` class outlined in Algorithm 4 of the FSST paper. See
/// the module documentation for a link to the paper.
Expand Down
9 changes: 6 additions & 3 deletions tests/correctness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,17 @@ fn test_train_on_empty() {

#[test]
fn test_large() {
// Generate 100KB of test data
let mut corpus = String::new();
// TODO(aduffy): make this larger once table build performance is better.
while corpus.len() < 10 * 1_024 {
corpus.push_str(DECLARATION);
}

let trained = fsst_rs::train(&corpus);
let compressed = trained.compress(corpus.as_bytes());
assert_eq!(trained.decompress(&compressed), corpus.as_bytes());
let mut massive = String::new();
while massive.len() < 16 * 1_024 * 1_024 {
massive.push_str(DECLARATION);
}
let compressed = trained.compress(massive.as_bytes());
assert_eq!(trained.decompress(&compressed), massive.as_bytes());
}

0 comments on commit 489537f

Please sign in to comment.