@@ -715,22 +715,22 @@ mod tests {
715715
716716 #[ test]
717717 fn test_float_operations ( ) {
718- let a = Value :: float ( Decimal :: from_f32 ( 5.5 ) . unwrap ( ) ) ;
718+ let a = Value :: float ( dec ! ( 5.5 ) ) ;
719719 let b = Value :: int ( 2 ) ;
720720
721721 assert_eq ! (
722722 a. add( & b) . unwrap( ) . unwrap_value( ) ,
723- Value :: float( Decimal :: from_f32 ( 7.5 ) . unwrap ( ) )
723+ Value :: float( dec! ( 7.5 ) )
724724 ) ;
725725 assert_eq ! (
726726 a. subtract( & b) . unwrap( ) . unwrap_value( ) ,
727- Value :: float( Decimal :: from_f32 ( 3.5 ) . unwrap ( ) )
727+ Value :: float( dec! ( 3.5 ) )
728728 ) ;
729729 assert_eq ! (
730730 a. multiply( & b) . unwrap( ) . unwrap_value( ) ,
731- Value :: float( Decimal :: from_f32 ( 11.0 ) . unwrap ( ) )
731+ Value :: float( dec! ( 11.0 ) )
732732 ) ;
733- assert_eq ! ( a. divide( & b) . unwrap( ) , Value :: float( Decimal :: from_f32 ( 2.75 ) . unwrap ( ) ) ) ;
733+ assert_eq ! ( a. divide( & b) . unwrap( ) , Value :: float( dec! ( 2.75 ) ) ) ;
734734 }
735735
736736 #[ test]
@@ -768,12 +768,12 @@ mod tests {
768768 #[ test]
769769 fn test_type_conversions ( ) {
770770 let int_val = Value :: int ( 42 ) ;
771- let float_val = Value :: float ( Decimal :: from_f32 ( 3.14 ) . unwrap ( ) ) ;
771+ let float_val = Value :: float ( dec ! ( 3.14 ) ) ;
772772
773- assert_eq ! ( int_val. to_float( ) , Some ( Decimal :: from ( 42 ) ) ) ;
773+ assert_eq ! ( int_val. to_float( ) , Some ( dec! ( 42 ) ) ) ;
774774 assert_eq ! ( float_val. to_int( ) , Some ( 3 ) ) ;
775775 assert_eq ! ( int_val. to_int( ) , Some ( 42 ) ) ;
776- assert_eq ! ( float_val. to_float( ) , Some ( Decimal :: from_f32 ( 3.14 ) . unwrap ( ) ) ) ;
776+ assert_eq ! ( float_val. to_float( ) , Some ( dec! ( 3.14 ) ) ) ;
777777 }
778778
779779 #[ test]
0 commit comments