Skip to content

Commit

Permalink
add unit test coverage for pkg/util/slice
Browse files Browse the repository at this point in the history
Signed-off-by: zhoumingcheng <zhoumingcheng@beyondcent.com>
  • Loading branch information
zhoumingcheng committed Jun 30, 2022
1 parent b2ed6ca commit 509c487
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/util/slice/slice_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ func TestContainsString(t *testing.T) {
if !ContainsString(src, "ee", modifier) {
t.Errorf("ContainsString didn't find the string by modifier")
}

src = make([]string, 0)
if ContainsString(src, "", nil) {
t.Errorf("The result returned is not the expected result")
}
}

func TestRemoveString(t *testing.T) {
Expand Down

0 comments on commit 509c487

Please sign in to comment.