[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master f998e62 2/5: Use lexical-binding in rfc2368.el and add tests
From: |
Stefan Kangas |
Subject: |
master f998e62 2/5: Use lexical-binding in rfc2368.el and add tests |
Date: |
Wed, 29 Apr 2020 07:10:58 -0400 (EDT) |
branch: master
commit f998e6297dde6c968f7a9f9a5a959d3533c45f02
Author: Stefan Kangas <address@hidden>
Commit: Stefan Kangas <address@hidden>
Use lexical-binding in rfc2368.el and add tests
* lisp/mail/rfc2368.el: Use lexical-binding.
* test/lisp/mail/rfc2368-tests.el: New file.
---
lisp/mail/rfc2368.el | 2 +-
test/lisp/mail/rfc2368-tests.el | 39 +++++++++++++++++++++++++++++++++++++++
2 files changed, 40 insertions(+), 1 deletion(-)
diff --git a/lisp/mail/rfc2368.el b/lisp/mail/rfc2368.el
index 7b38288..afa3059 100644
--- a/lisp/mail/rfc2368.el
+++ b/lisp/mail/rfc2368.el
@@ -1,4 +1,4 @@
-;;; rfc2368.el --- support for rfc2368
+;;; rfc2368.el --- support for rfc2368 -*- lexical-binding:t -*-
;; Copyright (C) 1998, 2000-2020 Free Software Foundation, Inc.
diff --git a/test/lisp/mail/rfc2368-tests.el b/test/lisp/mail/rfc2368-tests.el
new file mode 100644
index 0000000..c35b8e3
--- /dev/null
+++ b/test/lisp/mail/rfc2368-tests.el
@@ -0,0 +1,39 @@
+;;; rfc2368-tests.el --- Tests for rfc2368.el -*- lexical-binding:t -*-
+
+;; Copyright (C) 2020 Free Software Foundation, Inc.
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;;; Code:
+
+(require 'ert)
+(require 'rfc2368)
+
+(ert-deftest rfc2368-unhexify-string ()
+ (should (equal (rfc2368-unhexify-string "hello%20there") "hello there")))
+
+(ert-deftest rfc2368-parse-mailto-url ()
+ (should (equal (rfc2368-parse-mailto-url
"mailto:address@hidden?subject=Foo&bar=baz")
+ '(("To" . "address@hidden") ("Subject" . "Foo") ("Bar" .
"baz"))))
+ (should (equal (rfc2368-parse-mailto-url
"mailto:address@hidden?to=address@hidden")
+ '(("To" . "address@hidden, address@hidden"))))
+ (should (equal (rfc2368-parse-mailto-url
"mailto:address@hidden?subject=bar%20baz")
+ '(("To" . "address@hidden") ("Subject" . "bar baz")))))
+
+(provide 'rfc2368-tests)
+;;; rfc2368-tests.el ends here