diff --git a/math/dec_internal_test.go b/math/dec_internal_test.go index 248bd4bc45..0680cf0094 100644 --- a/math/dec_internal_test.go +++ b/math/dec_internal_test.go @@ -17,9 +17,35 @@ func TestDecimalInternalTestSuite(t *testing.T) { } func (s *decimalInternalTestSuite) TestPrecisionMultiplier() { - res := precisionMultiplier(5) - exp := big.NewInt(10000000000000) - s.Require().Equal(0, res.Cmp(exp), "equality was incorrect, res %v, exp %v", res, exp) + tests := []struct { + prec int64 + exp *big.Int + }{ + { + 5, + big.NewInt(10000000000000), + }, + { + 8, + big.NewInt(10000000000), + }, + { + 11, + big.NewInt(10000000), + }, + { + 15, + big.NewInt(1000), + }, + { + 18, + big.NewInt(1), + }, + } + for _, tt := range tests { + res := precisionMultiplier(tt.prec) + s.Require().Equal(0, res.Cmp(tt.exp), "equality was incorrect, res %v, exp %v", res, tt.exp) + } } func (s *decimalInternalTestSuite) TestZeroDeserializationJSON() {