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

Function TestBasic_Merge

mapstructure_test.go:334–355  ·  mapstructure_test.go::TestBasic_Merge
(t *testing.T)

Source from the content-addressed store, hash-verified

332}
333
334func TestBasic_Merge(t *testing.T) {
335 t.Parallel()
336
337 input := map[string]interface{}{
338 "vint": 42,
339 }
340
341 var result Basic
342 result.Vuint = 100
343 err := Decode(input, &result)
344 if err != nil {
345 t.Fatalf("got an err: %s", err)
346 }
347
348 expected := Basic{
349 Vint: 42,
350 Vuint: 100,
351 }
352 if !reflect.DeepEqual(result, expected) {
353 t.Fatalf("bad: %#v", result)
354 }
355}
356
357// Test for issue #46.
358func TestBasic_Struct(t *testing.T) {

Callers

nothing calls this directly

Calls 1

DecodeFunction · 0.85

Tested by

no test coverage detected