Browse Source

Merge pull request #604 from libp2p/chore/improve-nil-option-tests

chore: improve nil option tests
pull/606/head
Steven Allen 6 years ago
committed by GitHub
parent
commit
f1888d98c4
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      libp2p_test.go

7
libp2p_test.go

@ -146,12 +146,17 @@ func TestChainOptions(t *testing.T) {
return nil
}
}
if err := cfg.Apply(newOpt(), nil, ChainOptions(newOpt(), newOpt(), ChainOptions(), ChainOptions(nil, newOpt()))); err != nil {
t.Fatal(err)
}
if optcount != len(optsRun) {
// Make sure we ran all options.
if optcount != 4 {
t.Errorf("expected to have handled %d options, handled %d", optcount, len(optsRun))
}
// Make sure we ran the options in-order.
for i, x := range optsRun {
if i != x {
t.Errorf("expected opt %d, got opt %d", i, x)

Loading…
Cancel
Save