MCPcopy
hub / github.com/go-sql-driver/mysql / TestConvertDerivedByteSlice

Function TestConvertDerivedByteSlice

statement_test.go:31–42  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

29}
30
31func TestConvertDerivedByteSlice(t *testing.T) {
32 type derived []uint8
33
34 output, err := converter{}.ConvertValue(derived("value"))
35 if err != nil {
36 t.Fatal("Byte slice not convertible", err)
37 }
38
39 if !bytes.Equal(output.([]byte), []byte("value")) {
40 t.Fatalf("Byte slice not converted, got %#v %T", output, output)
41 }
42}
43
44func TestConvertDerivedUnsupportedSlice(t *testing.T) {
45 type derived []int

Callers

nothing calls this directly

Calls 2

derivedTypeAlias · 0.85
ConvertValueMethod · 0.80

Tested by

no test coverage detected