mirror of
https://github.com/logos-messaging/go-libp2p-pubsub.git
synced 2026-01-04 22:03:07 +00:00
add test for invalid message author
This commit is contained in:
parent
96066d320f
commit
9c7bc987f7
@ -1083,3 +1083,15 @@ func TestPubsubWithAssortedOptions(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestWithInvalidMessageAuthor(t *testing.T) {
|
||||
// this test exercises the failure path in the WithMessageAuthor option
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
defer cancel()
|
||||
|
||||
h := bhost.NewBlankHost(swarmt.GenSwarm(t, ctx))
|
||||
_, err := NewFloodSub(ctx, h, WithMessageAuthor("bogotr0n"))
|
||||
if err == nil {
|
||||
t.Fatal("expected error")
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user