~ubuntu-branches/ubuntu/saucy/wl/saucy-proposed

« back to all changes in this revision

Viewing changes to tests/test-rfc2368.el

  • Committer: Bazaar Package Importer
  • Author(s): Tatsuya Kinoshita
  • Date: 2007-01-02 21:08:54 UTC
  • mfrom: (3.1.3 edgy)
  • Revision ID: james.westby@ubuntu.com-20070102210854-nw929130dlxgi6q3
Tags: 2.14.0-4
elmo/elmo-imap4.el: Fix "IMAP error: No `OK' response from server",
patch from upstream CVS version. (closes: #405284)

Show diffs side-by-side

added added

removed removed

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