Skip to content

Commit

Permalink
fix incomplete coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
zostay committed Jul 14, 2023
1 parent a08ffdd commit e4aba95
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions Changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ WIP TBD

* Added slices.FirstIndex and slices.GrepIndex.
* Added set.NewSized and set.Diff.
* Fixed missing test coverage on generic.FirstNonNil and generic.FirstNonZero.

v0.2.0 2023-07-08

Expand Down
2 changes: 2 additions & 0 deletions generic/value_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ func TestFirstNonZero(t *testing.T) {
assert.Equal(t, 1, generic.FirstNonZero[int](0, 1, 2))
assert.Equal(t, 1, generic.FirstNonZero[int](1, 0, 2))
assert.Equal(t, 1, generic.FirstNonZero[int](0, 0, 1))
assert.Equal(t, 0, generic.FirstNonZero[int](0, 0, 0))
}

func TestFirstNonNil(t *testing.T) {
Expand All @@ -24,6 +25,7 @@ func TestFirstNonNil(t *testing.T) {
assert.Equal(t, *b, *generic.FirstNonNil(a, b, c))
assert.Equal(t, *b, *generic.FirstNonNil(b, a, c))
assert.Equal(t, *b, *generic.FirstNonNil(a, a, b))
assert.Nil(t, generic.FirstNonNil[int](nil, nil, nil))
}

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

0 comments on commit e4aba95

Please sign in to comment.