(t *testing.T)
| 1076 | func (TildeNullInt64) ArrayDelimiter() string { return "~" } |
| 1077 | |
| 1078 | func 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 | |
| 1091 | func TestGenericArrayScanErrors(t *testing.T) { |
| 1092 | var sa [1]string |
nothing calls this directly
no test coverage detected
searching dependent graphs…