Skip to content

Commit

Permalink
add test get_n_elms_per_felt
Browse files Browse the repository at this point in the history
  • Loading branch information
ftheirs committed Dec 31, 2024
1 parent e84933c commit ae53c1f
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions crates/starknet-os/src/hints/compression.rs
Original file line number Diff line number Diff line change
Expand Up @@ -281,3 +281,23 @@ pub fn set_decompressed_dst(

Ok(())
}

#[cfg(test)]
mod tests {
use rstest::rstest;

use super::*;

#[rstest]
#[case(0, MAX_N_BITS)]
#[case(1, MAX_N_BITS)]
#[case(16, 62)]
#[case(10, 62)]
#[case(100, 35)]
#[case(500, 27)]
#[case(10000, 17)]
#[case(125789, 14)]
fn test_get_n_elms_per_felt(#[case] input: usize, #[case] expected: usize) {
assert_eq!(get_n_elms_per_felt(input), expected);
}
}

0 comments on commit ae53c1f

Please sign in to comment.