Skip to content

Commit fea9afd

Browse files
authored
Merge pull request ipfs/interface-go-ipfs-core#28 from ipfs/fix/dht-test
tests: fix a bunch of small test lints/issues This commit was moved from ipfs/interface-go-ipfs-core@0d5ec37
2 parents 25b9995 + d493b70 commit fea9afd

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

coreiface/tests/dht.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -130,17 +130,17 @@ func (tp *provider) TestDhtProvide(t *testing.T) {
130130
t.Fatal(err)
131131
}
132132

133-
provider := <-out
133+
_, ok := <-out
134+
135+
if ok {
136+
t.Fatal("did not expect to find any providers")
137+
}
134138

135139
self0, err := apis[0].Key().Self(ctx)
136140
if err != nil {
137141
t.Fatal(err)
138142
}
139143

140-
if provider.ID.String() != "<peer.ID >" {
141-
t.Errorf("got wrong provider: %s != %s", provider.ID.String(), self0.ID().String())
142-
}
143-
144144
err = apis[0].Dht().Provide(ctx, p)
145145
if err != nil {
146146
t.Fatal(err)
@@ -151,7 +151,7 @@ func (tp *provider) TestDhtProvide(t *testing.T) {
151151
t.Fatal(err)
152152
}
153153

154-
provider = <-out
154+
provider := <-out
155155

156156
if provider.ID.String() != self0.ID().String() {
157157
t.Errorf("got wrong provider: %s != %s", provider.ID.String(), self0.ID().String())

0 commit comments

Comments
 (0)