| 636 | } |
| 637 | |
| 638 | func TestDecode_EmbeddedSquash(t *testing.T) { |
| 639 | t.Parallel() |
| 640 | |
| 641 | input := map[string]interface{}{ |
| 642 | "vstring": "foo", |
| 643 | "vunique": "bar", |
| 644 | } |
| 645 | |
| 646 | var result EmbeddedSquash |
| 647 | err := Decode(input, &result) |
| 648 | if err != nil { |
| 649 | t.Fatalf("got an err: %s", err.Error()) |
| 650 | } |
| 651 | |
| 652 | if result.Vstring != "foo" { |
| 653 | t.Errorf("vstring value should be 'foo': %#v", result.Vstring) |
| 654 | } |
| 655 | |
| 656 | if result.Vunique != "bar" { |
| 657 | t.Errorf("vunique value should be 'bar': %#v", result.Vunique) |
| 658 | } |
| 659 | } |
| 660 | |
| 661 | func TestDecodeFrom_EmbeddedSquash(t *testing.T) { |
| 662 | t.Parallel() |