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

Function TestDecode_decodeSliceWithArray

mapstructure_test.go:574–587  ·  mapstructure_test.go::TestDecode_decodeSliceWithArray
(t *testing.T)

Source from the content-addressed store, hash-verified

572}
573
574func TestDecode_decodeSliceWithArray(t *testing.T) {
575 t.Parallel()
576
577 var result []int
578 input := [1]int{1}
579 expected := []int{1}
580 if err := Decode(input, &result); err != nil {
581 t.Fatalf("got an err: %s", err.Error())
582 }
583
584 if !reflect.DeepEqual(expected, result) {
585 t.Errorf("wanted %+v, got %+v", expected, result)
586 }
587}
588
589func TestDecode_EmbeddedNoSquash(t *testing.T) {
590 t.Parallel()

Callers

nothing calls this directly

Calls 2

DecodeFunction · 0.85
ErrorMethod · 0.80

Tested by

no test coverage detected