diff options
author | René 'Necoro' Neumann <necoro@necoro.eu> | 2021-10-17 14:02:09 +0200 |
---|---|---|
committer | René 'Necoro' Neumann <necoro@necoro.eu> | 2021-10-17 14:02:09 +0200 |
commit | 925683b5810a3707831a30ac59a7a446af21c5f1 (patch) | |
tree | b899bbcfbf1315dd82a15f92a018dec2d7286ab5 | |
parent | e21ebee1652c09f5fd42f389530c29ab5e98df33 (diff) | |
download | feed2imap-go-925683b5810a3707831a30ac59a7a446af21c5f1.tar.gz feed2imap-go-925683b5810a3707831a30ac59a7a446af21c5f1.tar.bz2 feed2imap-go-925683b5810a3707831a30ac59a7a446af21c5f1.zip |
#62: Fix tests (empty root is now allowed)
Diffstat (limited to '')
-rw-r--r-- | pkg/config/url_test.go | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/pkg/config/url_test.go b/pkg/config/url_test.go index d345690..492ccd8 100644 --- a/pkg/config/url_test.go +++ b/pkg/config/url_test.go @@ -43,8 +43,22 @@ func TestUrl_Unmarshal(t *testing.T) { {name: "Err: Inv scheme", inp: `url: "smtp://user%40example:pass@example.net:4711/INBOX"`, wantErr: true}, {name: "Err: No Host", inp: `url: "imap://user%40example:pass/INBOX"`, wantErr: true}, {name: "Err: Scheme Only", inp: `url: "imap://"`, wantErr: true}, - {name: "Err: No Root", inp: `url: "imap://user:pass@example.net:143"`, wantErr: true}, - {name: "Err: No Root: Slash", inp: `url: "imap://user:pass@example.net:143/"`, wantErr: true}, + {name: "No Root", inp: `url: "imap://user:pass@example.net:143"`, url: Url{ + Scheme: "imap", + User: "user", + Password: "pass", + Host: "example.net", + Port: "143", + Root: "", + }}, + {name: "No Root: Slash", inp: `url: "imap://user:pass@example.net:143/"`, url: Url{ + Scheme: "imap", + User: "user", + Password: "pass", + Host: "example.net", + Port: "143", + Root: "/", + }}, {name: "Full", inp: `url: scheme: imap host: example.net |