MarshalContains converts actual to YAML and succeeds if expected is in the result.
(actual any, expected string)
| 74 | |
| 75 | // MarshalContains converts actual to YAML and succeeds if expected is in the result. |
| 76 | func 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. |
| 85 | func MarshalMatches(actual any, expected string) Comparison { |