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

Function TestDecode_BasicSquash

mapstructure_test.go:426–442  ·  mapstructure_test.go::TestDecode_BasicSquash
(t *testing.T)

Source from the content-addressed store, hash-verified

424}
425
426func TestDecode_BasicSquash(t *testing.T) {
427 t.Parallel()
428
429 input := map[string]interface{}{
430 "vstring": "foo",
431 }
432
433 var result BasicSquash
434 err := Decode(input, &result)
435 if err != nil {
436 t.Fatalf("got an err: %s", err.Error())
437 }
438
439 if result.Test.Vstring != "foo" {
440 t.Errorf("vstring value should be 'foo': %#v", result.Test.Vstring)
441 }
442}
443
444func TestDecodeFrom_BasicSquash(t *testing.T) {
445 t.Parallel()

Callers

nothing calls this directly

Calls 2

DecodeFunction · 0.85
ErrorMethod · 0.80

Tested by

no test coverage detected