aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorBasil L. Contovounesios2019-07-22 21:48:45 +0100
committerBasil L. Contovounesios2019-08-02 16:33:30 +0300
commitb4b1eda7fbf4c4f3fa6377bd18d1d1a22e6e4b42 (patch)
tree3b827b0cd5491f2d853f9ea0d325f0457c344ad3 /test
parentcf569e520ee080b5a913d37d363a5ab5fc38d982 (diff)
downloademacs-b4b1eda7fbf4c4f3fa6377bd18d1d1a22e6e4b42.tar.gz
emacs-b4b1eda7fbf4c4f3fa6377bd18d1d1a22e6e4b42.zip
Fix some minor gravatar.el issues
For discussion, see the following thread: https://lists.gnu.org/archive/html/emacs-devel/2019-07/msg00528.html * lisp/image/gravatar.el (gravatar-hash): Trim leading and trailing whitespace in given address, as per the Gravatar docs. (gravatar-retrieve-synchronously): Silence call to url-retrieve-synchronously for consistency with gravatar-retrieve. (gravatar-retrieved): Only cache buffer on successful retrieval. * test/lisp/image/gravatar-tests.el: New file.
Diffstat (limited to 'test')
-rw-r--r--test/lisp/image/gravatar-tests.el34
1 files changed, 34 insertions, 0 deletions
diff --git a/test/lisp/image/gravatar-tests.el b/test/lisp/image/gravatar-tests.el
new file mode 100644
index 00000000000..e6239da0084
--- /dev/null
+++ b/test/lisp/image/gravatar-tests.el
@@ -0,0 +1,34 @@
1;;; gravatar-tests.el --- tests for gravatar.el -*- lexical-binding: t -*-
2
3;; Copyright (C) 2019 Free Software Foundation, Inc.
4
5;; This file is part of GNU Emacs.
6
7;; GNU Emacs is free software: you can redistribute it and/or modify
8;; it under the terms of the GNU General Public License as published by
9;; the Free Software Foundation, either version 3 of the License, or
10;; (at your option) any later version.
11
12;; GNU Emacs is distributed in the hope that it will be useful,
13;; but WITHOUT ANY WARRANTY; without even the implied warranty of
14;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15;; GNU General Public License for more details.
16
17;; You should have received a copy of the GNU General Public License
18;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
19
20;;; Code:
21
22(require 'ert)
23(require 'gravatar)
24
25(ert-deftest gravatar-hash ()
26 "Test `gravatar-hash'."
27 (should (equal (gravatar-hash "") "d41d8cd98f00b204e9800998ecf8427e"))
28 (let ((hash "acbd18db4cc2f85cedef654fccc4a4d8"))
29 (should (equal (gravatar-hash "foo") hash))
30 (should (equal (gravatar-hash "foo ") hash))
31 (should (equal (gravatar-hash " foo") hash))
32 (should (equal (gravatar-hash " foo ") hash))))
33
34;;; gravatar-tests.el ends here