This commit is contained in:
admju
2024-09-09 10:11:10 +00:00
parent 53a614bd7e
commit a1af83689d
6 changed files with 65 additions and 14 deletions

22
src/utils/slice_test.go Normal file
View 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")
}