aboutsummaryrefslogtreecommitdiff
path: root/pkg/config/yaml_test.go
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.eu>2021-02-21 17:02:18 +0100
committerRené 'Necoro' Neumann <necoro@necoro.eu>2021-02-21 17:43:31 +0100
commita67e0e15cb1ff73c0faf7b4f9cdcd168ffbfa423 (patch)
tree403af7d1488b6b6b75c7386924c1a6bc54a22579 /pkg/config/yaml_test.go
parent5516a376a230ae98bd308e3b5ccbaafd8d6f4ab1 (diff)
downloadfeed2imap-go-a67e0e15cb1ff73c0faf7b4f9cdcd168ffbfa423.tar.gz
feed2imap-go-a67e0e15cb1ff73c0faf7b4f9cdcd168ffbfa423.tar.bz2
feed2imap-go-a67e0e15cb1ff73c0faf7b4f9cdcd168ffbfa423.zip
Strip whitespace from folder names
Diffstat (limited to 'pkg/config/yaml_test.go')
-rw-r--r--pkg/config/yaml_test.go12
1 files changed, 12 insertions, 0 deletions
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"}},