diff options
Diffstat (limited to 'pkg/config')
-rw-r--r-- | pkg/config/yaml.go | 1 | ||||
-rw-r--r-- | pkg/config/yaml_test.go | 12 |
2 files changed, 13 insertions, 0 deletions
diff --git a/pkg/config/yaml.go b/pkg/config/yaml.go index 9dd74a9..c82a57e 100644 --- a/pkg/config/yaml.go +++ b/pkg/config/yaml.go @@ -133,6 +133,7 @@ func (cfg *Config) parse(in io.Reader) error { } func appTarget(target []string, app string) []string { + app = strings.TrimSpace(app) switch { case len(target) == 0 && app == "": return []string{} diff --git a/pkg/config/yaml_test.go b/pkg/config/yaml_test.go index c8d6071..b4d5c9c 100644 --- a/pkg/config/yaml_test.go +++ b/pkg/config/yaml_test.go @@ -94,6 +94,12 @@ func TestBuildFeeds(tst *testing.T) { }, result: Feeds{"muh": &Feed{Name: "muh", Target: t("moep.foo")}}, }, + {name: "Simple With Target and Whitespace", wantErr: false, target: "moep", + feeds: []configGroupFeed{ + {Target: n("\r\nfoo "), Feed: feed{Name: "muh"}}, + }, + result: Feeds{"muh": &Feed{Name: "muh", Target: t("moep.foo")}}, + }, {name: "Simple With Target and NoAutoTarget", wantErr: false, target: "moep", noAutoTarget: true, feeds: []configGroupFeed{ {Target: n("foo"), Feed: feed{Name: "muh"}}, @@ -124,6 +130,12 @@ func TestBuildFeeds(tst *testing.T) { }, result: Feeds{"muh": &Feed{Name: "muh", Target: t("moep")}}, }, + {name: "Simple With Blank Target", wantErr: false, target: "moep", + feeds: []configGroupFeed{ + {Target: n(" "), Feed: feed{Name: "muh"}}, + }, + result: Feeds{"muh": &Feed{Name: "muh", Target: t("moep")}}, + }, {name: "Multiple Feeds", wantErr: false, target: "moep", feeds: []configGroupFeed{ {Target: n("foo"), Feed: feed{Name: "muh"}}, |