summaryrefslogtreecommitdiff
path: root/libpod/util_test.go
blob: b3d336d1f91298c806b41dc861e8493edcaf7bf1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package libpod


import (
	"testing"
	"github.com/stretchr/testify/assert"
)
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{}))
}