updated tests
This commit is contained in:
parent
bac0119f1b
commit
d800360ea2
@ -27,7 +27,10 @@ func TestFindByNeighbors(t *testing.T) {
|
||||
SourceID: pools.RouteServers.Get("rs1"),
|
||||
}
|
||||
|
||||
routes, err := b.FindByNeighbors(ctx, []*api.NeighborQuery{q})
|
||||
routes, err := b.FindByNeighbors(
|
||||
ctx,
|
||||
[]*api.NeighborQuery{q},
|
||||
api.NewSearchFilters())
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@ -68,7 +71,7 @@ func TestConcurrentRoutesAccess(t *testing.T) {
|
||||
for i := 0; i < 200000; i++ {
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
b.FindByNeighbors(ctx, []*api.NeighborQuery{n1, n2})
|
||||
b.FindByNeighbors(ctx, []*api.NeighborQuery{n1, n2}, api.NewSearchFilters())
|
||||
wg.Done()
|
||||
}()
|
||||
}
|
||||
|
@ -122,7 +122,10 @@ func TestFindByNeighbors(t *testing.T) {
|
||||
SourceID: pools.RouteServers.Acquire("rs2"),
|
||||
}
|
||||
|
||||
routes, err := b.FindByNeighbors(ctx, []*api.NeighborQuery{nq1, nq2})
|
||||
routes, err := b.FindByNeighbors(
|
||||
ctx,
|
||||
[]*api.NeighborQuery{nq1, nq2},
|
||||
api.NewSearchFilters())
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@ -178,7 +181,7 @@ func TestFindByPrefix(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
routes, err := b.FindByPrefix(ctx, "1.2.")
|
||||
routes, err := b.FindByPrefix(ctx, "1.2.", api.NewSearchFilters(), 0)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@ -187,6 +190,6 @@ func TestFindByPrefix(t *testing.T) {
|
||||
t.Error("unexpected routes:", routes)
|
||||
}
|
||||
|
||||
routes, _ = b.FindByPrefix(ctx, "5.5.")
|
||||
routes, _ = b.FindByPrefix(ctx, "5.5.", api.NewSearchFilters(), 0)
|
||||
t.Log(routes)
|
||||
}
|
||||
|
@ -122,7 +122,10 @@ func TestLookupPrefix(t *testing.T) {
|
||||
store := makeTestRoutesStore()
|
||||
query := "193.200."
|
||||
|
||||
results, err := store.LookupPrefix(context.Background(), query)
|
||||
results, err := store.LookupPrefix(
|
||||
context.Background(),
|
||||
query,
|
||||
api.NewSearchFilters())
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@ -157,7 +160,10 @@ func TestLookupPrefixForNeighbors(t *testing.T) {
|
||||
store := makeTestRoutesStore()
|
||||
|
||||
// Query
|
||||
results, err := store.LookupPrefixForNeighbors(context.Background(), neighbors)
|
||||
results, err := store.LookupPrefixForNeighbors(
|
||||
context.Background(),
|
||||
neighbors,
|
||||
api.NewSearchFilters())
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user