MCPcopy Create free account
hub / github.com/cozystack/talm / assertContains

Function assertContains

pkg/engine/render_test.go:200–205  ·  view source on GitHub ↗

assertContains checks that the output contains the expected substring.

(t *testing.T, output string, substr string)

Source from the content-addressed store, hash-verified

198
199// assertContains checks that the output contains the expected substring.
200func assertContains(t *testing.T, output string, substr string) {
201 t.Helper()
202 if !strings.Contains(output, substr) {
203 t.Errorf("expected output to contain %q, but it does not.\nOutput:\n%s", substr, output)
204 }
205}
206
207// assertNotContains checks that the output does NOT contain the substring.
208func assertNotContains(t *testing.T, output string, substr string) {

Calls

no outgoing calls

Tested by

no test coverage detected