Skip to content

Commit

Permalink
test larger decimal string
Browse files Browse the repository at this point in the history
  • Loading branch information
ekiwi committed Jan 20, 2025
1 parent 24e48dc commit c5e27ab
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tests/bitvec_to_from_str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,17 @@ fn test_to_from_dec_str_regression() {
}

#[test]
fn test_to_from_dec_str() {
fn test_to_from_dec_str_small_value() {
let dec_str = "34";
let value = BitVecValue::from_str_radix(dec_str, 10, 512).unwrap();
assert_eq!(value.to_u64().unwrap(), 34);
assert_eq!(value.to_dec_str(), dec_str);
}

#[test]
fn test_to_from_dec_str_large_value() {
let dec_str = "596886253802847701482483271715688189726967057213902170277048855852747875443594200622744233395250662615839263196891363475349438107920290669854978619157637";
let value = BitVecValue::from_str_radix(dec_str, 10, 512).unwrap();
}

proptest! {
Expand Down

0 comments on commit c5e27ab

Please sign in to comment.