@@ -828,20 +828,32 @@ fn test_parse_scientific_zero() {
828
828
}
829
829
830
830
#[ test]
831
- fn test_parse_valid_hexadecimal_float ( ) {
831
+ fn test_parse_valid_hexadecimal_float_two_args ( ) {
832
832
let test_cases = [
833
- ( vec ! [ "0x1p-1" , "2" ] , "0.5\n 1.5\n " ) ,
834
- ( vec ! [ "1" , "0x1p-1" , "2" ] , "1\n 1.5\n 2\n " ) ,
835
- ( vec ! [ "0x3.4p-1" , "0x4p-1" , "4" ] , "1.625\n 3.625\n " ) ,
836
- ( vec ! [ "0x.8p16" , "32768" ] , "32768\n " ) ,
833
+ ( [ "0x1p-1" , "2" ] , "0.5\n 1.5\n " ) ,
834
+ ( [ "0x.8p16" , "32768" ] , "32768\n " ) ,
835
+ ( [ "0xffff.4p-4" , "4096" ] , "4095.95\n " ) ,
836
+ ( [ "0xA.A9p-1" , "6" ] , "5.33008\n " ) ,
837
+ ( [ "0xa.a9p-1" , "6" ] , "5.33008\n " ) ,
838
+ ( [ "0xffffffffffp-30" , "1024" ] , "1024\n " ) , // spell-checker:disable-line
839
+ ] ;
840
+
841
+ for ( input_arguments, expected_output) in & test_cases {
842
+ new_ucmd ! ( )
843
+ . args ( input_arguments)
844
+ . succeeds ( )
845
+ . stdout_only ( expected_output) ;
846
+ }
847
+ }
848
+
849
+ #[ test]
850
+ fn test_parse_valid_hexadecimal_float_three_args ( ) {
851
+ let test_cases = [
852
+ ( [ "0x3.4p-1" , "0x4p-1" , "4" ] , "1.625\n 3.625\n " ) ,
837
853
(
838
- vec ! [ "-0x.ep-3" , "-0x.1p-3" , "-0x.fp-3" ] ,
854
+ [ "-0x.ep-3" , "-0x.1p-3" , "-0x.fp-3" ] ,
839
855
"-0.109375\n -0.117188\n " ,
840
856
) ,
841
- ( vec ! [ "0xffff.4p-4" , "4096" ] , "4095.95\n " ) ,
842
- ( vec ! [ "0xA.A9p-1" , "6" ] , "5.33008\n " ) ,
843
- ( vec ! [ "0xa.a9p-1" , "6" ] , "5.33008\n " ) ,
844
- ( vec ! [ "0xffffffffffp-30" , "1024" ] , "1024\n " ) ,
845
857
] ;
846
858
847
859
for ( input_arguments, expected_output) in & test_cases {
0 commit comments