MCPcopy
hub / github.com/shopspring/decimal / TestNewFromFloat32Quick

Function TestNewFromFloat32Quick

decimal_test.go:193–205  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

191}
192
193func TestNewFromFloat32Quick(t *testing.T) {
194 err := quick.Check(func(f float32) bool {
195 want, werr := NewFromString(strconv.FormatFloat(float64(f), 'f', -1, 32))
196 if werr != nil {
197 return true
198 }
199 got := NewFromFloat32(f)
200 return got.Equal(want)
201 }, &quick.Config{})
202 if err != nil {
203 t.Error(err)
204 }
205}
206
207func TestNewFromString(t *testing.T) {
208 for _, x := range testTable {

Callers

nothing calls this directly

Calls 3

NewFromStringFunction · 0.85
NewFromFloat32Function · 0.85
EqualMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…