(t *testing.T)
| 89 | type empty any |
| 90 | |
| 91 | func TestEncodeMapStringNamedInterface(t *testing.T) { |
| 92 | val := map[string]empty{"foo": "bar"} |
| 93 | buf := new(bytes.Buffer) |
| 94 | fds := make([]int, 0) |
| 95 | order := binary.LittleEndian |
| 96 | enc := newEncoder(buf, binary.LittleEndian, fds) |
| 97 | err := enc.Encode(val) |
| 98 | if err != nil { |
| 99 | t.Fatal(err) |
| 100 | } |
| 101 | |
| 102 | dec := newDecoder(buf, order, enc.fds) |
| 103 | v, err := dec.Decode(SignatureOf(val)) |
| 104 | if err != nil { |
| 105 | t.Fatal(err) |
| 106 | } |
| 107 | out := map[string]empty{} |
| 108 | if err := Store(v, &out); err != nil { |
| 109 | t.Fatal(err) |
| 110 | } |
| 111 | if !reflect.DeepEqual(out, val) { |
| 112 | t.Errorf("not equal: got '%v', want '%v'", |
| 113 | out, val) |
| 114 | } |
| 115 | } |
| 116 | |
| 117 | type fooer interface { |
| 118 | Foo() |
nothing calls this directly
no test coverage detected
searching dependent graphs…