github.com/docker/app@v0.9.1-beta3.0.20210611140623-a48f773ab002/internal/slices/slices_test.go (about) 1 package slices 2 3 import ( 4 "testing" 5 6 "gotest.tools/assert" 7 ) 8 9 func TestContainsString(t *testing.T) { 10 assert.Check(t, !ContainsString(nil, "foo")) 11 assert.Check(t, !ContainsString([]string{}, "foo")) 12 assert.Check(t, !ContainsString([]string{"foobar"}, "foo")) 13 assert.Check(t, ContainsString([]string{"foo", "bar"}, "foo")) 14 assert.Check(t, ContainsString([]string{"foo", "bar"}, "bar")) 15 }