alertmanager/cli/check_config_test.go

18 lines
333 B
Go
Raw Normal View History

package cli
import (
"testing"
)
func TestCheckConfig(t *testing.T) {
err := CheckConfig([]string{"testdata/conf.good.yml"})
if err != nil {
t.Fatalf("Checking valid config file failed with: %v", err)
}
err = CheckConfig([]string{"testdata/conf.bad.yml"})
if err == nil {
t.Fatalf("Failed to detect invalid file.")
}
}