(t *testing.T)
| 123 | func (fooimpl) Foo() {} |
| 124 | |
| 125 | func TestEncodeMapStringNonEmptyInterface(t *testing.T) { |
| 126 | val := map[string]fooer{"foo": fooimpl("bar")} |
| 127 | buf := new(bytes.Buffer) |
| 128 | fds := make([]int, 0) |
| 129 | order := binary.LittleEndian |
| 130 | enc := newEncoder(buf, binary.LittleEndian, fds) |
| 131 | err := enc.Encode(val) |
| 132 | if err != nil { |
| 133 | t.Fatal(err) |
| 134 | } |
| 135 | |
| 136 | dec := newDecoder(buf, order, enc.fds) |
| 137 | v, err := dec.Decode(SignatureOf(val)) |
| 138 | if err != nil { |
| 139 | t.Fatal(err) |
| 140 | } |
| 141 | out := map[string]fooer{} |
| 142 | err = Store(v, &out) |
| 143 | if err == nil { |
| 144 | t.Fatal("Shouldn't be able to convert to non empty interfaces") |
| 145 | } |
| 146 | } |
| 147 | |
| 148 | func TestEncodeSliceInterface(t *testing.T) { |
| 149 | val := []any{"foo", "bar"} |
nothing calls this directly
no test coverage detected
searching dependent graphs…