cosmos-sdk/math/legacy_dec_fuzz_test.go
Alexander Peters 4ed1087cf5
feat(math): Upstream GDA based decimal type (#21982)
Co-authored-by: samricotta <samanthalricotta@gmail.com>
Co-authored-by: samricotta <37125168+samricotta@users.noreply.github.com>
2024-11-22 10:29:01 +00:00

25 lines
444 B
Go

package math
import (
"testing"
)
func FuzzLegacyNewDecFromStr(f *testing.F) {
if testing.Short() {
f.Skip("running in -short mode")
}
f.Add("-123.456")
f.Add("123.456789")
f.Add("123456789")
f.Add("0.12123456789")
f.Add("-12123456789")
f.Fuzz(func(t *testing.T, input string) {
dec, err := LegacyNewDecFromStr(input)
if err != nil && !dec.IsNil() {
t.Fatalf("Inconsistency: dec.notNil=%v yet err=%v", dec, err)
}
})
}