mirror of
https://github.com/containers/podman
synced 2024-10-20 17:23:30 +00:00
20 lines
420 B
Go
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{}))
|
||
|
}
|