mirror of
https://source.quilibrium.com/quilibrium/ceremonyclient.git
synced 2024-12-27 17:15:18 +00:00
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(c *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)
|
|
}
|
|
}
|