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

Function TestDecimal_Overflow

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

Source from the content-addressed store, hash-verified

2234}
2235
2236func TestDecimal_Overflow(t *testing.T) {
2237 if !didPanic(func() { New(1, math.MinInt32).Mul(New(1, math.MinInt32)) }) {
2238 t.Fatalf("should have gotten an overflow panic")
2239 }
2240 if !didPanic(func() { New(1, math.MaxInt32).Mul(New(1, math.MaxInt32)) }) {
2241 t.Fatalf("should have gotten an overflow panic")
2242 }
2243}
2244
2245func TestDecimal_ExtremeValues(t *testing.T) {
2246 // NOTE(vadim): this test takes pretty much forever

Callers

nothing calls this directly

Calls 3

didPanicFunction · 0.85
NewFunction · 0.85
MulMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…