aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorStefan Kangas2022-07-08 11:02:17 +0200
committerStefan Kangas2022-07-08 11:02:45 +0200
commitf85683c434ffdb72b4c33bd5231b08d288a0b9b2 (patch)
treeeab66002f3bfdeb54ffa1a9b06d0ba197cbf4e59 /test
parent989908eee8d78d70c5e475a9cb1bb710d7b54b5f (diff)
downloademacs-f85683c434ffdb72b4c33bd5231b08d288a0b9b2.tar.gz
emacs-f85683c434ffdb72b4c33bd5231b08d288a0b9b2.zip
Add tests for mail-extr.el
* test/lisp/mail/mail-extr-tests.el: New file.
Diffstat (limited to 'test')
-rw-r--r--test/lisp/mail/mail-extr-tests.el41
1 files changed, 41 insertions, 0 deletions
diff --git a/test/lisp/mail/mail-extr-tests.el b/test/lisp/mail/mail-extr-tests.el
new file mode 100644
index 00000000000..a8f0c605cb0
--- /dev/null
+++ b/test/lisp/mail/mail-extr-tests.el
@@ -0,0 +1,41 @@
1;;; mail-extr-tests.el --- Tests for mail-extr.el -*- lexical-binding: t -*-
2
3;; Copyright (C) 2022 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;;; Commentary:
21
22;;; Code:
23
24(require 'ert)
25(require 'mail-extr)
26
27(defconst mail-extract-test-cases
28 '(("foo@example.org" . (nil "foo@example.org"))
29 ("J. Random Hacker <foo@example.org>" . ("J. Random Hacker" "foo@example.org"))
30 ("\"J. Random Hacker\" <foo@example.org>" . ("J. Random Hacker" "foo@example.org"))
31 ("Ååå Äää <foo@example.org>" . ("Ååå Äää" "foo@example.org"))))
32
33(ert-deftest mail-extract-address-components ()
34 (dolist (test mail-extract-test-cases)
35 (should (equal (mail-extract-address-components (car test)) (cdr test)))))
36
37(ert-deftest what-domain ()
38 (should (equal (what-domain "cu") "CU: Cuba")))
39
40(provide 'mail-extr-tests)
41;;; mail-extr-tests.el ends here