MCPcopy Create free account
hub / github.com/CrunchyData/postgres-operator / MarshalContains

Function MarshalContains

internal/testing/cmp/cmp.go:76–82  ·  view source on GitHub ↗

MarshalContains converts actual to YAML and succeeds if expected is in the result.

(actual any, expected string)

Source from the content-addressed store, hash-verified

74
75// MarshalContains converts actual to YAML and succeeds if expected is in the result.
76func MarshalContains(actual any, expected string) Comparison {
77 b, err := yaml.Marshal(actual)
78 if err != nil {
79 return func() gotest.Result { return gotest.ResultFromError(err) }
80 }
81 return Contains(string(b), expected)
82}
83
84// MarshalMatches converts actual to YAML and compares that to expected.
85func MarshalMatches(actual any, expected string) Comparison {

Calls 1

ContainsFunction · 0.85