From fa0ba2d1f2314a5db097c2597ffafe15fe9e865a Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 6 Sep 2021 19:51:44 +0300 Subject: [PATCH] fix the test Signed-off-by: Your Name --- pkg/math/math_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/math/math_test.go b/pkg/math/math_test.go index c6e3678a..9a782202 100644 --- a/pkg/math/math_test.go +++ b/pkg/math/math_test.go @@ -122,7 +122,7 @@ func TestFloatToBigIntMul(t *testing.T) { for i, tc := range cases { act := FloatToBigIntMul(tc.input, tc.multiplier) - exp, ok := big.NewInt(0).SetString(fmt.Sprintf("%g", tc.expected), 10) + exp, ok := big.NewInt(0).SetString(fmt.Sprintf("%.0f", tc.expected), 10) testutil.Assert(t, ok, "failed to convert string to big int") testutil.Equals(t, exp, act, "Case:"+strconv.Itoa(i)) @@ -160,7 +160,7 @@ func TestBigIntToFloat(t *testing.T) { } for i, tc := range cases { - input, ok := big.NewInt(0).SetString(fmt.Sprintf("%g", tc.input), 10) + input, ok := big.NewInt(0).SetString(fmt.Sprintf("%.0f", tc.input), 10) testutil.Assert(t, ok, "failed to convert string to big int") act := BigIntToFloatDiv(input, tc.devider)