Skip to content

Commit

Permalink
add mocks to the fastcheck package (flyteorg#102)
Browse files Browse the repository at this point in the history
* added mocks to the fastcheck package

Signed-off-by: Daniel Rammer <[email protected]>

* added generic set test to fix codecov failing

Signed-off-by: Daniel Rammer <[email protected]>
  • Loading branch information
hamersaw authored Oct 20, 2021
1 parent 5b24be6 commit 433f7a9
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fastcheck/iface.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ import (
// For example an LRU cache, may have an overhead because of the use of a HashMap with loading factor and collision
// resolution
// The Data-structure is thread-safe and can be accessed by multiple threads concurrently.

//go:generate mockery -name Filter -case=underscore

type Filter interface {
// Contains returns a True if the id was previously seen or false otherwise
// It may return a false, even if a item may have previously occurred.
Expand Down
78 changes: 78 additions & 0 deletions fastcheck/mocks/filter.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions sets/generic_set_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,15 @@ func TestGenericSet(t *testing.T) {
assert.True(t, g2.IsSuperset(g1))
assert.False(t, g1.IsSuperset(g2))
}
{
g1 := NewGeneric(GenericVal("a"), GenericVal("b"))
g2 := g1.UnsortedListKeys()
assert.Equal(t, g1.Len(), len(g2))

for _, key := range g2 {
assert.True(t, g1.Has(GenericVal(key)))
}
}
{
g1 := NewGeneric(GenericVal("a"), GenericVal("b"))
assert.True(t, g1.Has(GenericVal("a")))
Expand Down

0 comments on commit 433f7a9

Please sign in to comment.