mirror of
https://github.com/duke-git/lancet.git
synced 2026-02-14 17:52:28 +08:00
test: add unit test for func IndexOf
This commit is contained in:
@@ -530,3 +530,11 @@ func TestShuffle(t *testing.T) {
|
|||||||
|
|
||||||
assert.Equal(5, len(res))
|
assert.Equal(5, len(res))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestIndexOf(t *testing.T) {
|
||||||
|
assert := internal.NewAssert(t, "TestIndexOf")
|
||||||
|
|
||||||
|
arr := []string{"a", "a", "b", "c"}
|
||||||
|
assert.Equal(0, IndexOf(arr, "a"))
|
||||||
|
assert.Equal(-1, IndexOf(arr, "d"))
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user