test
This commit is contained in:
22
src/utils/slice_test.go
Normal file
22
src/utils/slice_test.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
"testing"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestSliceInStringExist(t *testing.T) {
|
||||
liste := []string{"text1", "text2"}
|
||||
|
||||
res := StringInSlice("text1", liste)
|
||||
|
||||
assert.Truef(t, res, "error message %s", "text1")
|
||||
}
|
||||
|
||||
func TestSliceInStringNotExist(t *testing.T) {
|
||||
liste := []string{"text1", "text2"}
|
||||
|
||||
res := StringInSlice("text3", liste)
|
||||
|
||||
assert.Falsef(t, res, "error message %s", "text3")
|
||||
}
|
Reference in New Issue
Block a user