MCPcopy
hub / github.com/expr-lang/expr / TestContainsWrapper

Function TestContainsWrapper

internal/testify/assert/forward_assertions_test.go:181–200  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

179}
180
181func TestContainsWrapper(t *testing.T) {
182
183 assert := New(new(testing.T))
184 list := []string{"Foo", "Bar"}
185
186 if !assert.Contains("Hello World", "Hello") {
187 t.Error("Contains should return true: \"Hello World\" contains \"Hello\"")
188 }
189 if assert.Contains("Hello World", "Salut") {
190 t.Error("Contains should return false: \"Hello World\" does not contain \"Salut\"")
191 }
192
193 if !assert.Contains(list, "Foo") {
194 t.Error("Contains should return true: \"[\"Foo\", \"Bar\"]\" contains \"Foo\"")
195 }
196 if assert.Contains(list, "Salut") {
197 t.Error("Contains should return false: \"[\"Foo\", \"Bar\"]\" does not contain \"Salut\"")
198 }
199
200}
201
202func TestNotContainsWrapper(t *testing.T) {
203

Callers

nothing calls this directly

Calls 3

NewFunction · 0.70
ContainsMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…