From 925683b5810a3707831a30ac59a7a446af21c5f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20=27Necoro=27=20Neumann?= Date: Sun, 17 Oct 2021 14:02:09 +0200 Subject: #62: Fix tests (empty root is now allowed) --- pkg/config/url_test.go | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'pkg') 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 -- cgit v1.2.3