Issue 187
(t *testing.T)
| 403 | |
| 404 | // Issue 187 |
| 405 | func TestBasic_interfaceStructNonPtr(t *testing.T) { |
| 406 | t.Parallel() |
| 407 | |
| 408 | input := map[string]interface{}{ |
| 409 | "vstring": "foo", |
| 410 | } |
| 411 | |
| 412 | var iface interface{} = Basic{} |
| 413 | err := Decode(input, &iface) |
| 414 | if err != nil { |
| 415 | t.Fatalf("got an err: %s", err) |
| 416 | } |
| 417 | |
| 418 | expected := Basic{ |
| 419 | Vstring: "foo", |
| 420 | } |
| 421 | if !reflect.DeepEqual(iface, expected) { |
| 422 | t.Fatalf("bad: %#v", iface) |
| 423 | } |
| 424 | } |
| 425 | |
| 426 | func TestDecode_BasicSquash(t *testing.T) { |
| 427 | t.Parallel() |