Skip to content

Commit

Permalink
Add unit test for RemoveBy()
Browse files Browse the repository at this point in the history
Signed-off-by: yah01 <[email protected]>
  • Loading branch information
yah01 committed Jun 9, 2022
1 parent ab16126 commit f30266e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions map_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ func TestIndexMap(t *testing.T) {
assert.Nil(t, imap.GetBy(NameIndex, persons[0].Name))
assert.Empty(t, imap.GetAllBy(NameIndex, persons[0].Name))

imap.RemoveBy(CityIndex, "San Francisco")
assert.Empty(t, imap.GetAllBy(CityIndex, "San Francisco"))
assert.Equal(t, 1, len(imap.GetAllBy(CityIndex, "Shanghai")))

// Update
imap.Clear()
InsertData(imap, persons)
Expand Down

0 comments on commit f30266e

Please sign in to comment.