Don't mark unread messages with important or answered flag read
[elisp/wanderlust.git] / tests / test-rfc2368.el
1 ;; -*- lexical-binding: t -*-
2 (require 'lunit)
3 (require 'rfc2368)
4
5 (luna-define-class test-rfc2368 (lunit-test-case))
6
7 (luna-define-method test-rfc2368-parse-mailto-url-1 ((case test-rfc2368))
8   "To field only."
9   (lunit-assert
10    (equal
11     '(("To" . "chris@example.com"))
12     (rfc2368-parse-mailto-url "mailto:chris@example.com"))))
13
14 (luna-define-method test-rfc2368-parse-mailto-url-2 ((case test-rfc2368))
15   "RFC2368 example in 2. Syntax of a mailto URL "
16   (lunit-assert
17    (equal
18     (rfc2368-parse-mailto-url "mailto:addr1%2C%20addr2")
19     (rfc2368-parse-mailto-url "mailto:?to=addr1%2C%20addr2")))
20   (lunit-assert
21    (equal
22     (rfc2368-parse-mailto-url "mailto:?to=addr1%2C%20addr2")
23     (rfc2368-parse-mailto-url "mailto:addr1?to=addr2"))))
24
25 (luna-define-method test-rfc2368-parse-mailto-url-3 ((case test-rfc2368))
26   "With Subject field."
27   (lunit-assert
28    (equal
29     '(("To" . "infobot@example.com")
30       ("Subject" . "current-issue"))
31     (rfc2368-parse-mailto-url
32      "mailto:infobot@example.com?subject=current-issue"))))
33
34 (luna-define-method test-rfc2368-parse-mailto-url-4 ((case test-rfc2368))
35   "Space in Subject field."
36   (lunit-assert
37    (equal
38     '(("To" . "infobot@example.com")
39       ("Body" . "send current-issue"))
40     (rfc2368-parse-mailto-url
41      "mailto:infobot@example.com?body=send%20current-issue"))))
42
43 (luna-define-method test-rfc2368-parse-mailto-url-5 ((case test-rfc2368))
44   "CRLF in body."
45   (lunit-assert
46    (equal
47     '(("To" . "infobot@example.com")
48       ("Body" . "send current-issue\nsend index"))
49     (rfc2368-parse-mailto-url
50      (concat "mailto:infobot@example.com?body=send%20current-\n"
51              "issue%0D%0Asend%20index")))))