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

Function TestDecimal_Value

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

Source from the content-addressed store, hash-verified

2474}
2475
2476func TestDecimal_Value(t *testing.T) {
2477 // Make sure this does implement the database/sql's driver.Valuer interface
2478 var d Decimal
2479 if _, ok := interface{}(d).(driver.Valuer); !ok {
2480 t.Error("Decimal does not implement driver.Valuer")
2481 }
2482
2483 // check that normal case is handled appropriately
2484 a := New(1234, -2)
2485 expected := "12.34"
2486 value, err := a.Value()
2487 if err != nil {
2488 t.Errorf("Decimal(12.34).Value() failed with message: %s", err)
2489 } else if value.(string) != expected {
2490 t.Errorf("%s does not equal to %s", a, expected)
2491 }
2492}
2493
2494// old tests after this line
2495

Callers

nothing calls this directly

Calls 2

NewFunction · 0.85
ValueMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…