mirror of
https://github.com/containers/podman.git
synced 2025-06-27 05:26:50 +08:00
Refactor: replace StringInSlice with slices.Contains
Signed-off-by: Oleksandr Redko <Oleksandr_Redko@epam.com>
This commit is contained in:
@ -13,10 +13,6 @@ import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
var (
|
||||
sliceData = []string{"one", "two", "three", "four"}
|
||||
)
|
||||
|
||||
func BreakInsert(mapping []idtools.IDMap, extension idtools.IDMap) (result []idtools.IDMap) {
|
||||
result = breakInsert(mapping, extension)
|
||||
result = sortAndMergeConsecutiveMappings(result)
|
||||
@ -485,15 +481,6 @@ func TestGetAvailableIDRanges(t *testing.T) {
|
||||
assert.Equal(t, expectedResult, result)
|
||||
}
|
||||
|
||||
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{}))
|
||||
}
|
||||
|
||||
func TestValidateSysctls(t *testing.T) {
|
||||
strSlice := []string{"net.core.test1=4", "kernel.msgmax=2"}
|
||||
result, _ := ValidateSysctls(strSlice)
|
||||
|
Reference in New Issue
Block a user