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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
6 additions and
1 deletions
-
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) |
|
|
|