1 package internal 2 3 import ( 4 "fmt" 5 "testing" 6 ) 7 8 func TestConfigMissingFields(t *testing.T) { 9 config := &Config{} 10 11 err := validateConfig(config) 12 if err == nil { 13 t.Error("err should not have been nil") 14 } 15 16 t.Log("error successfully caught") 17 t.Log(err) 18 } 19 20 func TestConfigPass(t *testing.T) { 21 config, err := NewConfigFromPath("testdata/goodconfig.yaml") 22 if err != nil { 23 t.Error(err) 24 } 25 fmt.Printf("%+v", config) 26 } 27