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