podman/pkg/util/utils_test.go
baude b85b217f55 Stage3 Image Library
This represents the stage3 implementation for the image library.  At this point, we
are moving the image-centric functions to pkg/image including migration of args and
object-oriented references.  This is a not a one-for-one migration of funcs and some
funcs will need to continue to reside in runtime_img as they are overly specific to
libpod and probably not useful to others.

Signed-off-by: baude <bbaude@redhat.com>

Closes: #484
Approved by: baude
2018-03-14 20:21:31 +00:00

20 lines
420 B
Go

package util
import (
"github.com/stretchr/testify/assert"
"testing"
)
var (
sliceData = []string{"one", "two", "three", "four"}
)
func TestStringInSlice(t *testing.T) {
// string is in the slice
assert.True(t, StringInSlice("one", sliceData))
// string is not in the slice
assert.False(t, StringInSlice("five", sliceData))
// string is not in empty slice
assert.False(t, StringInSlice("one", []string{}))
}