@@ -24,7 +24,7 @@ fn widen_i128() {
24
24
#[ test]
25
25
fn widen_mul_u128 ( ) {
26
26
let tests = [
27
- ( u128:: MAX / 2 , 2_u128 , u256 ( [ u64:: MAX , u64:: MAX , 0 , 0 ] ) ) ,
27
+ ( u128:: MAX / 2 , 2_u128 , u256 ( [ u64:: MAX - 1 , u64:: MAX , 0 , 0 ] ) ) ,
28
28
( u128:: MAX , 2_u128 , u256 ( [ u64:: MAX - 1 , u64:: MAX , 1 , 0 ] ) ) ,
29
29
( u128:: MAX , u128:: MAX , u256 ( [ 1 , 0 , u64:: MAX - 1 , u64:: MAX ] ) ) ,
30
30
( u128:: MIN , u128:: MIN , u256:: ZERO ) ,
@@ -33,15 +33,15 @@ fn widen_mul_u128() {
33
33
] ;
34
34
35
35
let mut errors = Vec :: new ( ) ;
36
- for ( a, b, exp) in tests {
36
+ for ( i , ( a, b, exp) ) in tests. iter ( ) . enumerate ( ) {
37
37
let res = a. zero_widen_mul ( b) ;
38
38
if res != exp {
39
- errors. push ( ( a, b, exp, res) ) ;
39
+ errors. push ( ( i , a, b, exp, res) ) ;
40
40
}
41
41
}
42
42
43
- for ( a, b, exp, res) in & errors {
44
- eprintln ! ( "FAILURE: {a:#036x } * {b:#036x } = {exp:#036x } got {res:#036x }" ) ;
43
+ for ( i , a, b, exp, res) in & errors {
44
+ eprintln ! ( "FAILURE ({i}) : {a:#034x } * {b:#034x } = {exp:x } got {res:x }" ) ;
45
45
}
46
46
assert ! ( errors. is_empty( ) ) ;
47
47
}
@@ -66,15 +66,15 @@ fn widen_mul_i128() {
66
66
] ;
67
67
68
68
let mut errors = Vec :: new ( ) ;
69
- for ( a, b, exp) in tests {
69
+ for ( i , ( a, b, exp) ) in tests. iter ( ) . enumerate ( ) {
70
70
let res = a. zero_widen_mul ( b) ;
71
71
if res != exp {
72
- errors. push ( ( a, b, exp, res) ) ;
72
+ errors. push ( ( i , a, b, exp, res) ) ;
73
73
}
74
74
}
75
75
76
- for ( a, b, exp, res) in & errors {
77
- eprintln ! ( "FAILURE: {a:#036x } * {b:#036x } = {exp:#036x } got {res:#036x }" ) ;
76
+ for ( i , a, b, exp, res) in & errors {
77
+ eprintln ! ( "FAILURE ({i}) : {a:#034x } * {b:#034x } = {exp:x } got {res:x }" ) ;
78
78
}
79
79
assert ! ( errors. is_empty( ) ) ;
80
80
}
0 commit comments