Skip to content

Commit

Permalink
added test
Browse files Browse the repository at this point in the history
  • Loading branch information
epi052 committed Mar 17, 2023
1 parent 0abc4b8 commit 0959a28
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -719,3 +719,22 @@ impl HasMaxSize for SharedState {
// need for it in feroxfuzz
}
}

#[cfg(test)]
mod tests {
use super::*;
use crate::corpora::RangeCorpus;

#[test]
fn default_state_can_add_corpus_after_creation() {
let mut state = SharedState::default();

assert_eq!(state.corpora().len(), 0);
assert_eq!(state.corpus_indices().len(), 0);

state.add_corpus(RangeCorpus::new().name("corpus").stop(10).build().unwrap());

assert_eq!(state.corpora().len(), 1);
assert_eq!(state.corpus_indices().len(), 1);
}
}

0 comments on commit 0959a28

Please sign in to comment.