Skip to content

Commit

Permalink
add a test for ListEntries
Browse files Browse the repository at this point in the history
  • Loading branch information
cipepser committed Mar 11, 2018
1 parent 6a772d5 commit 067055a
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions iblt/iblt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,28 @@ func TestIBLT_Delete(t *testing.T) {
})
}
}

func TestIBLT_ListEntries(t *testing.T) {
tests := []struct {
name string
want []Pair
}{
{
"ListEntries {2, 20} and {3, 30}",
[]Pair{
{2, 20},
{3, 30},
},
},
}
iblt := NewIBLT(10)
iblt.Insert(2, 20)
iblt.Insert(3, 30)
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := iblt.ListEntries(); !reflect.DeepEqual(got, tt.want) {
t.Errorf("IBLT.ListEntries() = %v, want %v", got, tt.want)
}
})
}
}

0 comments on commit 067055a

Please sign in to comment.