MCPcopy Create free account
hub / github.com/jmespath/go-jmespath / TestNotContains

Function TestNotContains

internal/testify/assert/assertions_test.go:594–619  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

592}
593
594func TestNotContains(t *testing.T) {
595
596 mockT := new(testing.T)
597 list := []string{"Foo", "Bar"}
598 simpleMap := map[interface{}]interface{}{"Foo": "Bar"}
599
600 if !NotContains(mockT, "Hello World", "Hello!") {
601 t.Error("NotContains should return true: \"Hello World\" does not contain \"Hello!\"")
602 }
603 if NotContains(mockT, "Hello World", "Hello") {
604 t.Error("NotContains should return false: \"Hello World\" contains \"Hello\"")
605 }
606
607 if !NotContains(mockT, list, "Foo!") {
608 t.Error("NotContains should return true: \"[\"Foo\", \"Bar\"]\" does not contain \"Foo!\"")
609 }
610 if NotContains(mockT, list, "Foo") {
611 t.Error("NotContains should return false: \"[\"Foo\", \"Bar\"]\" contains \"Foo\"")
612 }
613 if NotContains(mockT, simpleMap, "Foo") {
614 t.Error("Contains should return true: \"{\"Foo\": \"Bar\"}\" contains \"Foo\"")
615 }
616 if !NotContains(mockT, simpleMap, "Bar") {
617 t.Error("Contains should return false: \"{\"Foo\": \"Bar\"}\" does not contains \"Bar\"")
618 }
619}
620
621func TestSubset(t *testing.T) {
622 mockT := new(testing.T)

Callers

nothing calls this directly

Calls 2

NotContainsFunction · 0.70
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…