diff options
| author | Roland Shoemaker <roland@golang.org> | 2022-02-28 05:42:11 -0800 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2022-03-04 20:02:41 +0000 |
| commit | 2b8aa2b734721487bb718ee5fb6080f51b57efd9 (patch) | |
| tree | 30f2b73b04f5d2eb090e5246e1d84d4b8c9f5114 /src/internal/fuzz/encoding_test.go | |
| parent | 7d7b9bbc7a37d3b83936a8caea08e0be7240a125 (diff) | |
| download | go-2b8aa2b734721487bb718ee5fb6080f51b57efd9.tar.xz | |
internal/fuzz: handle Inf/NaN float values
Fixes #51258
Change-Id: I3c8b785ac912d66e1a6e2179625e6903032b8330
Reviewed-on: https://go-review.googlesource.com/c/go/+/388354
Reviewed-by: Bryan Mills <bcmills@google.com>
Trust: Roland Shoemaker <roland@golang.org>
Run-TryBot: Roland Shoemaker <roland@golang.org>
Auto-Submit: Roland Shoemaker <roland@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Diffstat (limited to 'src/internal/fuzz/encoding_test.go')
| -rw-r--r-- | src/internal/fuzz/encoding_test.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/internal/fuzz/encoding_test.go b/src/internal/fuzz/encoding_test.go index b429d429c6..4b55892acd 100644 --- a/src/internal/fuzz/encoding_test.go +++ b/src/internal/fuzz/encoding_test.go @@ -103,6 +103,20 @@ float64(-12.5) float32(2.5)`, ok: true, }, + { + in: `go test fuzz v1 +float32(-0) +float64(-0) +float32(+Inf) +float32(-Inf) +float32(NaN) +float64(+Inf) +float64(-Inf) +float64(NaN) +math.Float64frombits(9221120237041090560) +math.Float32frombits(2143289343)`, + ok: true, + }, } for _, test := range tests { t.Run(test.in, func(t *testing.T) { |
