Skip to content

Commit

Permalink
add test case with big scale to checked_from_scale_to_value function
Browse files Browse the repository at this point in the history
  • Loading branch information
zielvna committed Sep 20, 2023
1 parent 02a59fe commit 209ad2b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion decimal_core/src/factories.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,10 @@ pub fn generate_factories(characteristics: DecimalCharacteristics) -> proc_macro
assert_eq!(
#struct_name::checked_from_scale_to_value(max_val, 100_000).is_err(),
true
);
);

let result: i32 = #struct_name::checked_from_scale_to_value(1, 30).unwrap().try_into().unwrap();
assert_eq!(result, 0);
}

#[test]
Expand Down

0 comments on commit 209ad2b

Please sign in to comment.