MCPcopy Create free account
hub / github.com/aarondl/sqlboiler / TestGenericArrayScanDelimiter

Function TestGenericArrayScanDelimiter

types/array_test.go:1078–1089  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1076func (TildeNullInt64) ArrayDelimiter() string { return "~" }
1077
1078func TestGenericArrayScanDelimiter(t *testing.T) {
1079 src, expected, tnis := `{12~NULL~76}`,
1080 []TildeNullInt64{{sql.NullInt64{Int64: 12, Valid: true}}, {}, {sql.NullInt64{Int64: 76, Valid: true}}},
1081 []TildeNullInt64{{sql.NullInt64{Int64: 0, Valid: true}}, {}}
1082
1083 if err := (GenericArray{&tnis}).Scan(src); err != nil {
1084 t.Fatalf("Expected no error for %#v, got %v", src, err)
1085 }
1086 if !reflect.DeepEqual(tnis, expected) {
1087 t.Errorf("Expected %v for %#v, got %v", expected, src, tnis)
1088 }
1089}
1090
1091func TestGenericArrayScanErrors(t *testing.T) {
1092 var sa [1]string

Callers

nothing calls this directly

Calls 1

ScanMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…