From adb5b4a858c0f72fc807a4a94417361d0ba14f92 Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Sat, 3 Jun 2023 00:11:00 -0400 Subject: piem-inboxes: Allow :url values without a trailing slash The piem-inboxes documentation says that the :url value must end in a slash, which is confusing because 1) public-inbox does not require this and has examples in its docs without a slash and 2) some spots in piem already append a slash if needed. Add a piem-inbox-get wrapper that ensures the returned URL ends with a slash, and use it in all spots that retrieve an inbox's URL. Reported-by: Jelle Licht Link: https://inbox.kyleam.com/piem/87y1l9ualg.fsf@fsfe.org Message-ID: <20230603041100.200632-1-kyle@kyleam.com> --- tests/piem-tests.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tests/piem-tests.el') diff --git a/tests/piem-tests.el b/tests/piem-tests.el index 7f9f30f..b612b96 100644 --- a/tests/piem-tests.el +++ b/tests/piem-tests.el @@ -74,7 +74,7 @@ (piem-merged-inboxes)))) (let ((piem-get-inboxes-from-config nil) (piem-inboxes '(("inbox" :url "inbox-url")))) - (should (equal (piem-inbox-get :url "inbox") "inbox-url")))) + (should (equal (piem-inbox-url "inbox") "inbox-url/")))) (ert-deftest piem-merged-inboxes:from-config () (piem-clear-merged-inboxes) @@ -83,8 +83,8 @@ (piem-tests-with-pi-config piem-tests-sample-pi-config (should (equal (piem-inbox-get :address "foo") "foo@example.com")) - (should (equal (piem-inbox-get :url "foo") - "https://example.com/foo")) + (should (equal (piem-inbox-url "foo") + "https://example.com/foo/")) (should (equal (piem-inbox-coderepo "foo") "/code/foo/"))) (piem-tests-with-pi-config "" -- cgit v1.2.3