1 ;; -*- lexical-binding: t -*-
5 (luna-define-class test-rfc2368 (lunit-test-case))
7 (luna-define-method test-rfc2368-parse-mailto-url-1 ((case test-rfc2368))
11 '(("To" . "chris@example.com"))
12 (rfc2368-parse-mailto-url "mailto:chris@example.com"))))
14 (luna-define-method test-rfc2368-parse-mailto-url-2 ((case test-rfc2368))
15 "RFC2368 example in 2. Syntax of a mailto URL "
18 (rfc2368-parse-mailto-url "mailto:addr1%2C%20addr2")
19 (rfc2368-parse-mailto-url "mailto:?to=addr1%2C%20addr2")))
22 (rfc2368-parse-mailto-url "mailto:?to=addr1%2C%20addr2")
23 (rfc2368-parse-mailto-url "mailto:addr1?to=addr2"))))
25 (luna-define-method test-rfc2368-parse-mailto-url-3 ((case test-rfc2368))
29 '(("To" . "infobot@example.com")
30 ("Subject" . "current-issue"))
31 (rfc2368-parse-mailto-url
32 "mailto:infobot@example.com?subject=current-issue"))))
34 (luna-define-method test-rfc2368-parse-mailto-url-4 ((case test-rfc2368))
35 "Space in Subject field."
38 '(("To" . "infobot@example.com")
39 ("Body" . "send current-issue"))
40 (rfc2368-parse-mailto-url
41 "mailto:infobot@example.com?body=send%20current-issue"))))
43 (luna-define-method test-rfc2368-parse-mailto-url-5 ((case test-rfc2368))
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")))))