MCPcopy
hub / github.com/mitchellh/mapstructure / TestDecode_EmbeddedNoSquash

Function TestDecode_EmbeddedNoSquash

mapstructure_test.go:589–610  ·  mapstructure_test.go::TestDecode_EmbeddedNoSquash
(t *testing.T)

Source from the content-addressed store, hash-verified

587}
588
589func TestDecode_EmbeddedNoSquash(t *testing.T) {
590 t.Parallel()
591
592 input := map[string]interface{}{
593 "vstring": "foo",
594 "vunique": "bar",
595 }
596
597 var result Embedded
598 err := Decode(input, &result)
599 if err != nil {
600 t.Fatalf("got an err: %s", err.Error())
601 }
602
603 if result.Vstring != "" {
604 t.Errorf("vstring value should be empty: %#v", result.Vstring)
605 }
606
607 if result.Vunique != "bar" {
608 t.Errorf("vunique value should be 'bar': %#v", result.Vunique)
609 }
610}
611
612func TestDecode_EmbeddedPointerNoSquash(t *testing.T) {
613 t.Parallel()

Callers

nothing calls this directly

Calls 2

DecodeFunction · 0.85
ErrorMethod · 0.80

Tested by

no test coverage detected