(t *testing.T)
| 61 | } |
| 62 | |
| 63 | func TestEncodeMapStringInterface(t *testing.T) { |
| 64 | val := map[string]any{"foo": "bar"} |
| 65 | buf := new(bytes.Buffer) |
| 66 | fds := make([]int, 0) |
| 67 | order := binary.LittleEndian |
| 68 | enc := newEncoder(buf, binary.LittleEndian, fds) |
| 69 | err := enc.Encode(val) |
| 70 | if err != nil { |
| 71 | t.Fatal(err) |
| 72 | } |
| 73 | |
| 74 | dec := newDecoder(buf, order, enc.fds) |
| 75 | v, err := dec.Decode(SignatureOf(val)) |
| 76 | if err != nil { |
| 77 | t.Fatal(err) |
| 78 | } |
| 79 | out := map[string]any{} |
| 80 | if err := Store(v, &out); err != nil { |
| 81 | t.Fatal(err) |
| 82 | } |
| 83 | if !reflect.DeepEqual(out, val) { |
| 84 | t.Errorf("not equal: got '%v', want '%v'", |
| 85 | out, val) |
| 86 | } |
| 87 | } |
| 88 | |
| 89 | type empty any |
| 90 |
nothing calls this directly
no test coverage detected
searching dependent graphs…