Skip to content

Commit

Permalink
tests: cool doc comment :)
Browse files Browse the repository at this point in the history
  • Loading branch information
cchudant committed Sep 27, 2024
1 parent a66f56f commit ca72fc6
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion src/trie/iterator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,28 @@ impl<'a, H: StarkHash + Send + Sync, DB: BonsaiDatabase, ID: Id> MerkleTreeItera

#[cfg(test)]
mod tests {
//! The tree used in this series of cases looks like this:
//! ```
//! │
//! ┌▼┐
//! (1)│ │[0]
//! │ │
//! └┬┘
//! (7)┌▼┐
//! ┌────┴─┴────────┐
//! ┌▼┐ ┌▼┐
//! (6)│ │[0100] (5)│ │[000000]
//! │ │ │ │
//! └┬┘ │ │
//! (4)┌▼┐ │ │
//! ┌────┴─┴─────┐ │ │
//! │ ┌▼┐ │ │
//! (2)┌▼┐ (3)│ │[0] │ │
//! ┌──┴─┴─┐ │ │ │ │
//! │ │ └┬┘ └┬┘
//! 0x1 0x2 0x3 0x4
//! ```
use crate::{
databases::{create_rocks_db, RocksDB, RocksDBConfig},
id::{BasicId, Id},
Expand Down Expand Up @@ -421,7 +443,7 @@ mod tests {
proptest::proptest! {
// #![proptest_config(ProptestConfig::with_cases(5))] // comment this when developing, this is mostly for faster ci & whole workspace `cargo test`
#[test]
/// This proptest will apply the above seek_to cases in a random order
/// This proptest will apply the above seek_to cases in a random order, and possibly with duplicates.
fn proptest_seek_to(cases in vec(0..all_cases_len(), size_range(0..20)).boxed()) {
test_iterator_seek_to_inner(cases)
}
Expand Down

0 comments on commit ca72fc6

Please sign in to comment.