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

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{}))
}