MCPcopy
hub / github.com/stretchr/testify / TestContainsNotContainsOnNilValue

Function TestContainsNotContainsOnNilValue

assert/assertions_test.go:1160–1176  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1158}
1159
1160func TestContainsNotContainsOnNilValue(t *testing.T) {
1161 t.Parallel()
1162
1163 mockT := new(mockTestingT)
1164
1165 Contains(mockT, nil, "key")
1166 expectedFail := "<nil> could not be applied builtin len()"
1167 actualFail := mockT.errorString()
1168 if !strings.Contains(actualFail, expectedFail) {
1169 t.Errorf("Contains failure should include %q but was %q", expectedFail, actualFail)
1170 }
1171
1172 NotContains(mockT, nil, "key")
1173 if !strings.Contains(actualFail, expectedFail) {
1174 t.Errorf("Contains failure should include %q but was %q", expectedFail, actualFail)
1175 }
1176}
1177
1178func TestSubsetNotSubset(t *testing.T) {
1179 t.Parallel()

Callers

nothing calls this directly

Calls 5

errorStringMethod · 0.80
ContainsFunction · 0.70
NotContainsFunction · 0.70
ErrorfMethod · 0.65
ContainsMethod · 0.45

Tested by

no test coverage detected