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

Function scanHelper

decimal_test.go:2419–2430  ·  view source on GitHub ↗
(t *testing.T, dbval interface{}, expected Decimal)

Source from the content-addressed store, hash-verified

2417}
2418
2419func scanHelper(t *testing.T, dbval interface{}, expected Decimal) {
2420 t.Helper()
2421
2422 a := Decimal{}
2423 if err := a.Scan(dbval); err != nil {
2424 // Scan failed... no need to test result value
2425 t.Errorf("a.Scan(%v) failed with message: %s", dbval, err)
2426 } else if !a.Equal(expected) {
2427 // Scan succeeded... test resulting values
2428 t.Errorf("%s does not equal to %s", a, expected)
2429 }
2430}
2431
2432func TestDecimal_Scan(t *testing.T) {
2433 // test the Scan method that implements the sql.Scanner interface

Callers 1

TestDecimal_ScanFunction · 0.85

Calls 2

ScanMethod · 0.95
EqualMethod · 0.95

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…