diff options
Diffstat (limited to 'libpod/util_test.go')
-rw-r--r-- | libpod/util_test.go | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/libpod/util_test.go b/libpod/util_test.go new file mode 100644 index 000000000..24e5fdfac --- /dev/null +++ b/libpod/util_test.go @@ -0,0 +1,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{})) +} |