mirror of
https://github.com/QuilibriumNetwork/ceremonyclient.git
synced 2026-02-21 10:27:26 +08:00
* v2.1.0 [omit consensus and adjacent] - this commit will be amended with the full release after the file copy is complete * 2.1.0 main node rollup
24 lines
399 B
Go
24 lines
399 B
Go
package config
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
func TestNilOption(t *testing.T) {
|
|
var cfg Config
|
|
optsRun := 0
|
|
opt := func(_ *Config) error {
|
|
optsRun++
|
|
return nil
|
|
}
|
|
if err := cfg.Apply(nil); err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
if err := cfg.Apply(opt, nil, nil, opt, opt, nil); err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
if optsRun != 3 {
|
|
t.Fatalf("expected to have handled 3 options, handled %d", optsRun)
|
|
}
|
|
}
|