MCPcopy Create free account
hub / github.com/docker/cli / TestMarshalMapBad

Function TestMarshalMapBad

cli/command/formatter/reflect_test.go:54–64  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

52}
53
54func TestMarshalMapBad(t *testing.T) {
55 _, err := marshalMap(nil)
56 assert.Check(t, is.Error(err, "expected a pointer to a struct, got invalid"), "expected an error (argument is nil)")
57
58 _, err = marshalMap(dummy{})
59 assert.Check(t, is.Error(err, "expected a pointer to a struct, got struct"), "expected an error (argument is non-pointer)")
60
61 x := 42
62 _, err = marshalMap(&x)
63 assert.Check(t, is.Error(err, "expected a pointer to a struct, got a pointer to int"), "expected an error (argument is a pointer to non-struct)")
64}

Callers

nothing calls this directly

Calls 2

marshalMapFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…