* (TESTPAT): add full automatic testing capability.
authorakr <akr>
Sun, 19 Jul 1998 17:01:08 +0000 (17:01 +0000)
committerakr <akr>
Sun, 19 Jul 1998 17:01:08 +0000 (17:01 +0000)
TESTPAT

diff --git a/TESTPAT b/TESTPAT
index 5205d2d..37ed743 100644 (file)
--- a/TESTPAT
+++ b/TESTPAT
 ;zero-characters-encoded-word-hack      ; violate common sense (very tricky)
 ;quoted-encoded-word                   ; violate character sequence semantics
 
-;;; test driver for FLIM-FLAM (and FLIM)
+;;; test driver for FLAM (and FLIM)
 
-(defun decode (src dsts &rest opts)
+(defun decode-flam (src dsts &rest opts)
   (setq eword-lexical-analyze-cache nil)
   (setq eword-decode-sticked-encoded-word
     (or (memq 'permit-sticked-comment opts)
        (memq 'permit-sticked-special opts)))
   (setq eword-decode-quoted-encoded-word nil)
-  (if (stringp dsts) (setq dsts (list dsts)))
   (with-temp-buffer
     (insert src "\n" mail-header-separator)
     (eword-decode-header 'us-ascii mail-header-separator)
     (let ((result (buffer-substring (point-min) (point))))
       (if (member result dsts) t result))))
 
-(defun encode (src dsts &rest opts)
+(defun encode-flam (src dsts &rest opts)
   (setq eword-lexical-analyze-cache nil)
   (setq eword-decode-sticked-encoded-word nil)
   (setq eword-decode-quoted-encoded-word nil)
-  (if (stringp dsts) (setq dsts (list dsts)))
   (with-temp-buffer
     (insert src "\n" mail-header-separator)
     (goto-char (point-min))
     (let ((result (buffer-substring (point-min) (point))))
       (if (member result dsts) t result))))
 
+(setq decode-test 'decode-flam)
+(setq encode-test 'encode-flam)
+
+(setq decode-succ-count 0)
+(setq decode-all-count 0)
+(defun decode (src dsts &rest opts)
+  (if (stringp dsts) (setq dsts (list dsts)))
+  (setq decode-all-count (1+ decode-all-count))
+  (let ((res (condition-case nil
+              (apply decode-test src dsts opts)
+              (error nil))))
+    (if (eq res t)
+      (setq decode-succ-count (1+ decode-succ-count))
+      (insert (format "\n;fail;%S" res)))
+    res))
+
+(setq encode-succ-count 0)
+(setq encode-all-count 0)
+(defun encode (src dsts &rest opts)
+  (if (stringp dsts) (setq dsts (list dsts)))
+  (setq encode-all-count (1+ decode-all-count))
+  (let ((res (condition-case nil
+              (apply encode-test src dsts opts)
+              (error nil))))
+    (if (eq res t)
+      (setq encode-succ-count (1+ encode-succ-count))
+      (insert (format "\n;fail;%S" res)))
+    res))
+
+(defun report ()
+  (insert
+    (format "\n\"Decode: %d/%d  Encode: %d/%d\""
+      decode-succ-count decode-all-count
+      encode-succ-count encode-all-count)))
+
 ;;;start-test;;;
 
-;;; from RFC2047
+
+;; Section 1: Decoding examples from RFC2047
 
 (decode
 "From: =?US-ASCII?Q?Keith_Moore?= <moore@cs.utk.edu>"
 "From: Nathaniel Borenstein <nsb@thumper.bellcore.com>
        (=?iso-8859-8?b?7eXs+SDv4SDp7Oj08A==?=)"
 "From: Nathaniel Borenstein <nsb@thumper.bellcore.com> (\e.H\eNm\eNe\eNl\eNy \eNo\eNa \eNi\eNl\eNh\eNt\eNp)")\e*B
-; FLIM-FLAM
+; FLAM
 
 (decode
 "From: foo@bar.baz (=?ISO-8859-1?Q?a?=)"
 "Subject: (=?ISO-8859-1?Q?a?= =?ISO-8859-2?Q?_b?=)"
 "Subject: (=?ISO-8859-1?Q?a?= =?ISO-8859-2?Q?_b?=)")
 
-;;; by akr@jaist.ac.jp
+;; Section 2: Decoding trivial inputs.
 
 (decode
 "From: =?ISO-2022-JP?B?GyRCJCIbKEI=?= <akr@jaist.ac.jp>"
 "From: \e$B$"\e(B <akr@jaist.ac.jp>")
 
-(encode
-"From: \e$B$"\e(B <akr@jaist.ac.jp>"
-"From: =?ISO-2022-JP?B?GyRCJCIbKEI=?= <akr@jaist.ac.jp>")
-
 (decode
 "From: =?ISO-2022-JP?B?GyRCJCIbKEI=?= =?ISO-2022-JP?B?GyRCJCQbKEI=?=
  <akr@jaist.ac.jp>"
 "From: \e$B$"$$\e(B <akr@jaist.ac.jp>")
 
 (decode
-"From: =?ISO-2022-JP?B?GyRCJCIbKEI=?==?ISO-2022-JP?B?GyRCJCQbKEI=?=
- <akr@jaist.ac.jp>"
-"From: =?ISO-2022-JP?B?GyRCJCIbKEI=?==?ISO-2022-JP?B?GyRCJCQbKEI=?= <akr@jaist.ac.jp>")
-
-(decode
-"From: akr@jaist.ac.jp
- (=?ISO-2022-JP?B?GyRCJCIbKEI=?=\\a=?ISO-2022-JP?B?GyRCJCQbKEI=?=)"
-"From: akr@jaist.ac.jp (\e$B$"\e(B\\a\e$B$$\e(B)")
-; FLIM-FLAM
-
-(decode
-"From: akr@jaist.ac.jp
- (=?ISO-2022-JP?B?GyRCJCIbKEI=?=a=?ISO-2022-JP?B?GyRCJCQbKEI=?=)"
-"From: akr@jaist.ac.jp (=?ISO-2022-JP?B?GyRCJCIbKEI=?=a=?ISO-2022-JP?B?GyRCJCQbKEI=?=)")
-; FLIM-FLAM
-
-(decode
-"From: akr@jaist.ac.jp
- (=?ISO-2022-JP?B?GyRCJCIbKEI=?=(=?ISO-2022-JP?B?GyRCJCQbKEI=?=)=?ISO-2022-JP?B?GyRCJCYbKEI=?=)"
-"From: akr@jaist.ac.jp (=?ISO-2022-JP?B?GyRCJCIbKEI=?=(=?ISO-2022-JP?B?GyRCJCQbKEI=?=)=?ISO-2022-JP?B?GyRCJCYbKEI=?=)")
-; FLIM-FLAM
-
-(decode
-"From: akr@jaist.ac.jp
- (=?ISO-2022-JP?B?GyRCJCIbKEI=?=(=?ISO-2022-JP?B?GyRCJCQbKEI=?=)=?ISO-2022-JP?B?GyRCJCYbKEI=?=)"
-"From: akr@jaist.ac.jp (\e$B$"\e(B(\e$B$$\e(B)\e$B$&\e(B)"
-'ignore-76bytes-limit)
-
-(encode
-"From: akr@jaist.ac.jp (\e$B$"\e(B(\e$B$$\e(B)\e$B$&\e(B)"
-"From: akr@jaist.ac.jp
- (=?ISO-2022-JP?B?GyRCJCIbKEI=?=(=?ISO-2022-JP?B?GyRCJCQbKEI=?=)=?ISO-2022-JP?B?GyRCJCYbKEI=?=)"
-'ignore-76bytes-limit)
-; FLIM-FLAM
-
-(decode
 "From: akr@jaist.ac.jp (=?ISO-2022-JP?B?GyRCJCIbKEI=?=
  =?ISO-2022-JP?B?GyhC?=(=?ISO-2022-JP?B?GyRCJCQbKEI=?=
  =?ISO-2022-JP?B?GyhC?=)=?ISO-2022-JP?B?GyRCJCYbKEI=?=)"
 "From: akr@jaist.ac.jp (\e$B$"\e(B(\e$B$$\e(B)\e$B$&\e(B)")
 
-(encode
-"From: akr@jaist.ac.jp (\e$B$"\e(B(\e$B$$\e(B)\e$B$&\e(B)"
-"From: akr@jaist.ac.jp (=?ISO-2022-JP?B?GyRCJCIbKEI=?=
- =?ISO-2022-JP?B?GyhC?=(=?ISO-2022-JP?B?GyRCJCQbKEI=?=
- =?ISO-2022-JP?B?GyhC?=)=?ISO-2022-JP?B?GyRCJCYbKEI=?=)"
-'zero-characters-encoded-word-hack)
-; FLIM-FLAM
-
 (decode
 "From: a=?ISO-2022-JP?B?GyRCJCIbKEI=?= <akr@jaist.ac.jp>"
 "From: a=?ISO-2022-JP?B?GyRCJCIbKEI=?= <akr@jaist.ac.jp>")
 "From: a=?ISO-2022-JP?B?GyRCJCIbKEI=?=b <akr@jaist.ac.jp>")
 
 (decode
-"From: (a)=?ISO-2022-JP?B?GyRCJCIbKEI=?= <akr@jaist.ac.jp>"
-"From: (a)=?ISO-2022-JP?B?GyRCJCIbKEI=?= <akr@jaist.ac.jp>")
-
-(decode
-"From: =?ISO-2022-JP?B?GyRCJCIbKEI=?=(b) <akr@jaist.ac.jp>"
-"From: =?ISO-2022-JP?B?GyRCJCIbKEI=?=(b) <akr@jaist.ac.jp>")
-
-(decode
-"From: (a)=?ISO-2022-JP?B?GyRCJCIbKEI=?=(b) <akr@jaist.ac.jp>"
-"From: (a)=?ISO-2022-JP?B?GyRCJCIbKEI=?=(b) <akr@jaist.ac.jp>")
-
-(decode
-"From: (a)=?ISO-2022-JP?B?GyRCJCIbKEI=?= <akr@jaist.ac.jp>"
-"From: (a)\e$B$"\e(B <akr@jaist.ac.jp>"
-'permit-sticked-comment)
-
-(decode
-"From: =?ISO-2022-JP?B?GyRCJCIbKEI=?=(b) <akr@jaist.ac.jp>"
-"From: \e$B$"\e(B(b) <akr@jaist.ac.jp>"
-'permit-sticked-comment)
-
-(decode
-"From: (a)=?ISO-2022-JP?B?GyRCJCIbKEI=?=(b) <akr@jaist.ac.jp>"
-"From: (a)\e$B$"\e(B(b) <akr@jaist.ac.jp>"
-'permit-sticked-comment)
-
-(decode
-"From: \"a\"=?ISO-2022-JP?B?GyRCJCIbKEI=?= <akr@jaist.ac.jp>"
-"From: \"a\"=?ISO-2022-JP?B?GyRCJCIbKEI=?= <akr@jaist.ac.jp>")
-
-(decode
-"From: =?ISO-2022-JP?B?GyRCJCIbKEI=?=\"b\" <akr@jaist.ac.jp>"
-"From: =?ISO-2022-JP?B?GyRCJCIbKEI=?=\"b\" <akr@jaist.ac.jp>")
-
-(decode
-"From: \"a\"=?ISO-2022-JP?B?GyRCJCIbKEI=?=\"b\" <akr@jaist.ac.jp>"
-"From: \"a\"=?ISO-2022-JP?B?GyRCJCIbKEI=?=\"b\" <akr@jaist.ac.jp>")
-
-(decode
 "From: \"=?ISO-2022-JP?B?GyRCJCIbKEI=?=\" <akr@jaist.ac.jp>"
 "From: \"=?ISO-2022-JP?B?GyRCJCIbKEI=?=\" <akr@jaist.ac.jp>")
 
 (decode
 "From: < =?ISO-2022-JP?B?GyRCJCIbKEI=?= @jaist.ac.jp>"
 "From: < =?ISO-2022-JP?B?GyRCJCIbKEI=?= @jaist.ac.jp>")
-; FLIM-FLAM
+; FLAM
 
 (decode
 "From: =?ISO-2022-JP?Q?=1B=24BAA=1B=28B?= <akr@jaist.ac.jp>"
 "From: (=?US-ASCII?Q?(?=)foo@bar.baz(=?US-ASCII?Q?))baz@bar.foo(?=)"
 "From: (=?US-ASCII?Q?(?=)foo@bar.baz(=?US-ASCII?Q?))baz@bar.foo(?=)")
 
-(encode
-"From: \"\e$B$"\e(B(\e$B$"\e(B)\" <akr@jaist.ac.jp>"
-"From: =?ISO-2022-JP?B?GyRCJCIbKEIoGyRCJCIbKEIp?= <akr@jaist.ac.jp>")
-; FLIM-FLAM
-
 (decode
 "From: =?ISO-2022-JP?B?GyRCJCIbKEIoGyRCJCIbKEIp?= <akr@jaist.ac.jp>"
 "From: \"\e$B$"\e(B(\e$B$"\e(B)\" <akr@jaist.ac.jp>")
 
-(encode
-"From: \e$B$"\e(B(\e$B$"\e(B) <akr@jaist.ac.jp>"
-"From: =?ISO-2022-JP?B?GyRCJCIbKEIoGyRCJCIbKEIp?= <akr@jaist.ac.jp>"
-'encode-sticked-comment-as-atom)
-; FLIM-FLAM
-
-(encode
-"From: \e$B$"\e(B(\e$B$"\e(B) <akr@jaist.ac.jp>"
-"From: =?ISO-2022-JP?B?GyRCJCIbKEI=?=(=?ISO-2022-JP?B?GyRCJCIbKEI=?=)
- <akr@jaist.ac.jp>"
-'permit-sticked-comment)
-; FLIM-FLAM
-
-(encode
-"From: \e$B$"\e(B(\e$B$"\e(B) <akr@jaist.ac.jp>"
-"From: =?ISO-2022-JP?B?GyRCJCIbKEI=?= (=?ISO-2022-JP?B?GyRCJCIbKEI=?=)
- <akr@jaist.ac.jp>"
-'separate-sticked-comment)
-; FLIM-FLAM
-
-(decode
-"From: =?ISO-2022-JP?B?GyRCJCIbKEI=?=(=?ISO-2022-JP?B?GyRCJCIbKEI=?=)
- <akr@jaist.ac.jp>"
-"From: \e$B$"\e(B(\e$B$"\e(B) <akr@jaist.ac.jp>"
-'permit-sticked-comment)
-
 (decode
 "From: =?US-ASCII?Q?=28?= <akr@jaist.ac.jp>, =?US-ASCII?Q?=29?= <akr@jaist.ac.jp>"
 "From: \"(\" <akr@jaist.ac.jp>, \")\" <akr@jaist.ac.jp>")
 "From: =?ISO-2022-JP?B?YSJiGyRCJCIbKEJjXA==?= <akr@jaist.ac.jp>"
 "From: \"a\\\"b\e$B$"\e(Bc\\\\\" <akr@jaist.ac.jp>")
 
-(encode
-"From: \"a\\\"b\e$B$"\e(Bc\\\\\" <akr@jaist.ac.jp>"
-"From: =?ISO-2022-JP?B?YSJiGyRCJCIbKEJjXA==?= <akr@jaist.ac.jp>")
-; FLIM-FLAM
-
-(decode
-"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=<akr@jaist.ac.jp>"
-"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=<akr@jaist.ac.jp>")
-
-(decode
-"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=<akr@jaist.ac.jp>"
-"To: \e$B$"\e(B<akr@jaist.ac.jp>"
-'permit-sticked-special)
-
-(encode
-"To: \e$B$"\e(B<akr@jaist.ac.jp>"
-"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=<akr@jaist.ac.jp>"
-'permit-sticked-special)
-; FLIM-FLAM
-
-(encode
-"To: \e$B$"\e(B<akr@jaist.ac.jp>"
-"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?= <akr@jaist.ac.jp>"
-'separate-sticked-special)
-
-(decode
-"To: <akr@jaist.ac.jp>,=?ISO-2022-JP?B?GyRCJCIbKEI=?=<akr@jaist.ac.jp>"
-"To: <akr@jaist.ac.jp>,=?ISO-2022-JP?B?GyRCJCIbKEI=?=<akr@jaist.ac.jp>")
-
-(decode
-"To: <akr@jaist.ac.jp>,=?ISO-2022-JP?B?GyRCJCIbKEI=?=<akr@jaist.ac.jp>"
-"To: <akr@jaist.ac.jp>,\e$B$"\e(B<akr@jaist.ac.jp>"
-'permit-sticked-special)
-
-(encode
-"To: <akr@jaist.ac.jp>,\e$B$"\e(B<akr@jaist.ac.jp>"
-"To: <akr@jaist.ac.jp>,=?ISO-2022-JP?B?GyRCJCIbKEI=?=<akr@jaist.ac.jp>"
-'permit-sticked-special)
-; FLIM-FLAM
-
-(encode
-"To: <akr@jaist.ac.jp>,\e$B$"\e(B<akr@jaist.ac.jp>"
-"To: <akr@jaist.ac.jp>, =?ISO-2022-JP?B?GyRCJCIbKEI=?= <akr@jaist.ac.jp>"
-'separate-sticked-special)
-
-(decode
-"To: akr@jaist.ac.jp,=?ISO-2022-JP?B?GyRCJCIbKEI=?=<akr@jaist.ac.jp>"
-"To: akr@jaist.ac.jp,=?ISO-2022-JP?B?GyRCJCIbKEI=?=<akr@jaist.ac.jp>")
-
-(decode
-"To: akr@jaist.ac.jp,=?ISO-2022-JP?B?GyRCJCIbKEI=?=<akr@jaist.ac.jp>"
-"To: akr@jaist.ac.jp,\e$B$"\e(B<akr@jaist.ac.jp>"
-'permit-sticked-special)
-
-(encode
-"To: akr@jaist.ac.jp,\e$B$"\e(B<akr@jaist.ac.jp>"
-"To: akr@jaist.ac.jp,=?ISO-2022-JP?B?GyRCJCIbKEI=?=<akr@jaist.ac.jp>"
-'permit-sticked-special)
-; FLIM-FLAM
-
-(encode
-"To: akr@jaist.ac.jp,\e$B$"\e(B<akr@jaist.ac.jp>"
-"To: akr@jaist.ac.jp, =?ISO-2022-JP?B?GyRCJCIbKEI=?= <akr@jaist.ac.jp>"
-'separate-sticked-special)
-
-(decode
-"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=:akr@jaist.ac.jp;"
-"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=:akr@jaist.ac.jp;")
-
-(decode
-"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=:akr@jaist.ac.jp;"
-"To: \e$B$"\e(B:akr@jaist.ac.jp;"
-'permit-sticked-special)
-
-(encode
-"To: \e$B$"\e(B:akr@jaist.ac.jp;"
-"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=:akr@jaist.ac.jp;"
-'permit-sticked-special)
-; FLIM-FLAM
-
-(encode
-"To: \e$B$"\e(B:akr@jaist.ac.jp;"
-"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?= :akr@jaist.ac.jp;"
-'separate-sticked-special)
-; FLIM-FLAM
-
-(decode
-"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=:=?ISO-2022-JP?B?GyRCJCQbKEI=?=<akr@jaist.ac.jp>;"
-"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=:=?ISO-2022-JP?B?GyRCJCQbKEI=?=<akr@jaist.ac.jp>;")
-
-(decode
-"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=:=?ISO-2022-JP?B?GyRCJCQbKEI=?=<akr@jaist.ac.jp>;"
-"To: \e$B$"\e(B:\e$B$$\e(B<akr@jaist.ac.jp>;"
-'ignore-76bytes-limit 'permit-sticked-special)
-
-(encode
-"To: \e$B$"\e(B:\e$B$$\e(B<akr@jaist.ac.jp>;"
-"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=:=?ISO-2022-JP?B?GyRCJCQbKEI=?=<akr@jaist.ac.jp>;"
-'ignore-76bytes-limit 'permit-sticked-special)
-; FLIM-FLAM
-
-(encode
-"To: \e$B$"\e(B:\e$B$$\e(B<akr@jaist.ac.jp>;"
-"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=:=?ISO-2022-JP?B?GyRCJCQbKEI=?=
- =?ISO-2022-JP?B?GyhC?=<akr@jaist.ac.jp>;"
-'zero-characters-encoded-word-hack 'permit-sticked-special)
-; FLIM-FLAM
-
-(encode
-"To: \e$B$"\e(B:\e$B$$\e(B<akr@jaist.ac.jp>;"
-"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?= : =?ISO-2022-JP?B?GyRCJCQbKEI=?=
- <akr@jaist.ac.jp>;"
-'separate-sticked-special)
-; FLIM-FLAM
-
-(decode
-"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=:=?ISO-2022-JP?B?GyRCJCQbKEI=?=<foo@bar>,=?ISO-2022-JP?B?GyRCJCYbKEI=?=<foo@bar>;,=?ISO-2022-JP?B?GyRCJCgbKEI=?=<foo@bar>"
-"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=:=?ISO-2022-JP?B?GyRCJCQbKEI=?=<foo@bar>,=?ISO-2022-JP?B?GyRCJCYbKEI=?=<foo@bar>;,=?ISO-2022-JP?B?GyRCJCgbKEI=?=<foo@bar>")
-
-(decode
-"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=:=?ISO-2022-JP?B?GyRCJCQbKEI=?=<foo@bar>,=?ISO-2022-JP?B?GyRCJCYbKEI=?=<foo@bar>;,=?ISO-2022-JP?B?GyRCJCgbKEI=?=<foo@bar>"
-"To: \e$B$"\e(B:\e$B$$\e(B<foo@bar>,\e$B$&\e(B<foo@bar>;,\e$B$(\e(B<foo@bar>"
-'ignore-76bytes-limit 'permit-sticked-special)
-
-(encode
-"To: \e$B$"\e(B:\e$B$$\e(B<foo@bar>,\e$B$&\e(B<foo@bar>;,\e$B$(\e(B<foo@bar>"
-"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=:=?ISO-2022-JP?B?GyRCJCQbKEI=?=<foo@bar>,=?ISO-2022-JP?B?GyRCJCYbKEI=?=<foo@bar>;,=?ISO-2022-JP?B?GyRCJCgbKEI=?=<foo@bar>"
-'ignore-76bytes-limit 'permit-sticked-special)
-; FLIM-FLAM
-
-(encode
-"To: \e$B$"\e(B:\e$B$$\e(B<foo@bar>,\e$B$&\e(B<foo@bar>;,\e$B$(\e(B<foo@bar>"
-"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=:=?ISO-2022-JP?B?GyRCJCQbKEI=?=
- =?ISO-2022-JP?B?GyhC?=<foo@bar>,=?ISO-2022-JP?B?GyRCJCYbKEI=?=
- =?ISO-2022-JP?B?GyhC?=<foo@bar>;,=?ISO-2022-JP?B?GyRCJCgbKEI=?=<foo@bar>"
-'zero-characters-encoded-word-hack 'permit-sticked-special)
-; FLIM-FLAM
-
-(encode
-"To: \e$B$"\e(B:\e$B$$\e(B<foo@bar>,\e$B$&\e(B<foo@bar>;,\e$B$(\e(B<foo@bar>"
-"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?= : =?ISO-2022-JP?B?GyRCJCQbKEI=?=
- <foo@bar>, =?ISO-2022-JP?B?GyRCJCYbKEI=?= <foo@bar>;,
- =?ISO-2022-JP?B?GyRCJCgbKEI=?= <foo@bar>"
-'separate-sticked-special)
-; FLIM-FLAM
-
 (decode
 "Subject: =?ISO-2022-JP?B?GyRCJCIbKEI=?="
 "Subject: \e$B$"\e(B")
  =?ISO-2022-JP?B?GyRCJCQbKEI=?="
 "Subject: \e$B$"\e(B a \e$B$$\e(B")
 
-(encode
-"Subject: \e$B0$\e(B                                                                                                                          \e$BR_\e(B"
-"Subject: =?ISO-2022-JP?B?GyRCMCQbKEIgICAgICAgICAgICAgICAgICAgICAgICAgICAg?=
- =?US-ASCII?Q?____________________________________________________________?=
- =?ISO-2022-JP?B?ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIBskQlJfGyhC?=")
-; FLIM-FLAM
-
 (decode
 "Subject: =?ISO-2022-JP?B?GyRCMCQbKEIgICAgICAgICAgICAgICAgICAgICAgICAgICAg?=
  =?US-ASCII?Q?____________________________________________________________?=
  =?ISO-2022-JP?B?ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIBskQlJfGyhC?="
 "Subject: \e$B0$\e(B                                                                                                                          \e$BR_\e(B")
 
-(encode
-"Subject: \e$B0$\e(B                                                                                                                          \e$BR_\e(B"
-"Subject: =?ISO-2022-JP?B?GyQpQrCkICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICDS3w=="
-'ignore-76bytes-limit 'ignore-75bytes-limit)
-; FLIM-FLAM
-
-(decode
-"Subject:=?ISO-2022-JP?B?GyRCJCIbKEI=?="
-"Subject:=?ISO-2022-JP?B?GyRCJCIbKEI=?=")
-
-(decode
-"Subject:=?ISO-2022-JP?B?GyRCJCIbKEI=?="
-"Subject:\e$B$"\e(B"
-'permit-sticked-special)
-
-(encode
-"From: \e.A\eN! <akr@jaist.ac.jp>"\e*B
-"From: =?ISO-8859-1?Q?=A1?= <akr@jaist.ac.jp>")
-
 (decode
 "From: =?ISO-8859-1?Q?abcdefghijklmnopqrst=A1=28=29=22=5C?= <akr@jaist.ac.jp>"
 "From: \"abcdefghijklmnopqrst\e.A\eN!()\\\"\\\\\" <akr@jaist.ac.jp>")\e*B
 
-(encode
-"From: \"abcdefghijklmnopqrst\e.A\eN!()\\\"\\\\\" <akr@jaist.ac.jp>"\e*B
-"From: =?ISO-8859-1?Q?abcdefghijklmnopqrst=A1=28=29=22=5C?= <akr@jaist.ac.jp>")
-; FLIM-FLAM
-
-(encode
-"From: akr@jaist.ac.jp (abcdefghijklmnopqrst\e.A\eN!\\(\\)\"\\\\)"\e*B
-"From: akr@jaist.ac.jp (=?ISO-8859-1?Q?abcdefghijklmnopqrst=A1=28=29\"=5C?=)")
-; FLIM-FLAM
-
 (decode
 "Subject: ?= =?"
 "Subject: ?= =?")
 "Subject: =?ISO-2022-JP?B?GyRCJCIbKEI=?= a =?ISO-8859-8?Q?=E0?="
 "Subject: \e$B$"\e(B a \e.H\eN`")\e*B
 
-(encode
-"Subject: \e$B$"\e(B a \e.H\eN`"\e*B
-"Subject: =?ISO-2022-JP?B?GyRCJCIbKEI=?= a =?ISO-8859-8?Q?=E0?=")
-
 (decode
 "Subject: =?ISO-8859-8?Q?=E0?= =?ISO-2022-JP?B?GyRCTm0bKEI=?="
 "Subject: \e.H\eN`\e$BNm\e(B")\e*B
 
-(encode
-"Subject: \e.H\eN`\e$BNm\e(B"\e*B
-"Subject: =?ISO-8859-8?Q?=E0?= =?ISO-2022-JP?B?GyRCTm0bKEI=?=")
-; FLIM-FLAM
-
 (decode
 "Subject: =?ISO-8859-8?Q?=E0_?= =?ISO-2022-JP?B?GyRCTm0bKEI=?="
 "Subject: \e.H\eN` \e$BNm\e(B")\e*B
 
-(encode
-"Subject: \e.H\eN` \e$BNm\e(B"\e*B
-'("Subject: =?ISO-8859-8?Q?=E0_?= =?ISO-2022-JP?B?GyRCTm0bKEI=?="
-  "Subject: =?ISO-8859-8?Q?=E0?= =?ISO-2022-JP?B?IBskQk5tGyhC?="))
-
-(encode
-"Subject: \e.F\eNC\e$B4X?t\e(B"\e*B
-'("Subject: =?ISO-8859-7?Q?=C3?= =?ISO-2022-JP?B?GyRCNFg/dBsoQg==?="
-  "Subject: =?ISO-2022-JP-2?B?Gy5GG05DGyRCNFg/dBsoQg==?="))
-
 (decode
 "Subject: =?ISO-2022-JP-2?B?Gy5GG05DGyRCNFg/dBsoQg==?="
 "Subject: \e.F\eNC\e$B4X?t\e(B")\e*B
 "Subject: \e$B$"\e(B"
 'quoted-encoded-word)
 
-;;; quoted-encoded-word \e$BI=8=\e(B
+(decode
+"Subject: = =?ISO-2022-JP?B?GyRCJCIbKEI=?="
+"Subject: = \e$B$"\e(B")
+
+(decode
+"Subject: =? =?ISO-2022-JP?B?GyRCJCIbKEI=?="
+"Subject: =? \e$B$"\e(B")
+
+(decode
+"Subject: =?ISO-2022-JP =?ISO-2022-JP?B?GyRCJCIbKEI=?="
+"Subject: =?ISO-2022-JP \e$B$"\e(B")
+
+(decode
+"Subject: =?ISO-2022-JP? =?ISO-2022-JP?B?GyRCJCIbKEI=?="
+"Subject: =?ISO-2022-JP? \e$B$"\e(B")
+
+(decode
+"Subject: =?ISO-2022-JP?B =?ISO-2022-JP?B?GyRCJCIbKEI=?="
+"Subject: =?ISO-2022-JP?B \e$B$"\e(B")
+
+(decode
+"Subject: =?ISO-2022-JP?B? =?ISO-2022-JP?B?GyRCJCIbKEI=?="
+"Subject: =?ISO-2022-JP?B? \e$B$"\e(B")
+
+(decode
+"Subject: =?ISO-2022-JP?B?GyRCJCIbKEI =?ISO-2022-JP?B?GyRCJCIbKEI=?="
+"Subject: =?ISO-2022-JP?B?GyRCJCIbKEI \e$B$"\e(B")
+
+(decode
+"Subject: =?ISO-2022-JP?B?GyRCJCIbKEI= =?ISO-2022-JP?B?GyRCJCIbKEI=?="
+"Subject: =?ISO-2022-JP?B?GyRCJCIbKEI= \e$B$"\e(B")
+
+(decode
+"Subject: =?ISO-2022-JP?B?GyRCJCIbKEI=? =?ISO-2022-JP?B?GyRCJCIbKEI=?="
+"Subject: =?ISO-2022-JP?B?GyRCJCIbKEI=? \e$B$"\e(B")
+
+(decode
+"Subject: =?ISO-2022-JP?B?GyRCJCIbKEI=?= =?ISO-2022-JP?B?GyRCJCIbKEI=?="
+"Subject: \e$B$"$"\e(B")
+
+(decode
+"Subject: ==?ISO-2022-JP?B?GyRCJCIbKEI=?="
+"Subject: ==?ISO-2022-JP?B?GyRCJCIbKEI=?=")
+
+(decode
+"Subject: =?ISO-2022-JP?B?GyRCJCIbKEI=?=="
+"Subject: =?ISO-2022-JP?B?GyRCJCIbKEI=?==")
+
+;; Section 3: Decoding melancholy inputs.
+
+(decode
+"From:=?ISO-2022-JP?B?GyRCJCIbKEI=?= <akr@jaist.ac.jp>"
+"From:=?ISO-2022-JP?B?GyRCJCIbKEI=?= <akr@jaist.ac.jp>")
+; FLAM
+
+(decode
+"From: akr@jaist.ac.jp
+ (=?ISO-2022-JP?B?GyRCJCIbKEI=?=\\a=?ISO-2022-JP?B?GyRCJCQbKEI=?=)"
+"From: akr@jaist.ac.jp (\e$B$"\e(B\\a\e$B$$\e(B)")
+; FLAM
+
+(decode
+"From: (a)=?ISO-2022-JP?B?GyRCJCIbKEI=?= <akr@jaist.ac.jp>"
+"From: (a)=?ISO-2022-JP?B?GyRCJCIbKEI=?= <akr@jaist.ac.jp>")
+
+(decode
+"From: =?ISO-2022-JP?B?GyRCJCIbKEI=?=(b) <akr@jaist.ac.jp>"
+"From: =?ISO-2022-JP?B?GyRCJCIbKEI=?=(b) <akr@jaist.ac.jp>")
+
+(decode
+"From: (a)=?ISO-2022-JP?B?GyRCJCIbKEI=?=(b) <akr@jaist.ac.jp>"
+"From: (a)=?ISO-2022-JP?B?GyRCJCIbKEI=?=(b) <akr@jaist.ac.jp>")
+
+(decode
+"From: (a)=?ISO-2022-JP?B?GyRCJCIbKEI=?= <akr@jaist.ac.jp>"
+"From: (a)\e$B$"\e(B <akr@jaist.ac.jp>"
+'permit-sticked-comment)
+
+(decode
+"From: =?ISO-2022-JP?B?GyRCJCIbKEI=?=(b) <akr@jaist.ac.jp>"
+"From: \e$B$"\e(B(b) <akr@jaist.ac.jp>"
+'permit-sticked-comment)
+
+(decode
+"From: (a)=?ISO-2022-JP?B?GyRCJCIbKEI=?=(b) <akr@jaist.ac.jp>"
+"From: (a)\e$B$"\e(B(b) <akr@jaist.ac.jp>"
+'permit-sticked-comment)
+
+(decode
+"From: \"a\"=?ISO-2022-JP?B?GyRCJCIbKEI=?= <akr@jaist.ac.jp>"
+"From: \"a\"=?ISO-2022-JP?B?GyRCJCIbKEI=?= <akr@jaist.ac.jp>")
+
+(decode
+"From: =?ISO-2022-JP?B?GyRCJCIbKEI=?=\"b\" <akr@jaist.ac.jp>"
+"From: =?ISO-2022-JP?B?GyRCJCIbKEI=?=\"b\" <akr@jaist.ac.jp>")
+
+(decode
+"From: \"a\"=?ISO-2022-JP?B?GyRCJCIbKEI=?=\"b\" <akr@jaist.ac.jp>"
+"From: \"a\"=?ISO-2022-JP?B?GyRCJCIbKEI=?=\"b\" <akr@jaist.ac.jp>")
+
+(decode
+"From: =?ISO-2022-JP?B?GyRCJCIbKEI=?=(=?ISO-2022-JP?B?GyRCJCIbKEI=?=)
+ <akr@jaist.ac.jp>"
+"From: \e$B$"\e(B(\e$B$"\e(B) <akr@jaist.ac.jp>"
+'permit-sticked-comment)
+
+(decode
+"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=<akr@jaist.ac.jp>"
+"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=<akr@jaist.ac.jp>")
+
+(decode
+"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=<akr@jaist.ac.jp>"
+"To: \e$B$"\e(B<akr@jaist.ac.jp>"
+'permit-sticked-special)
+
+(decode
+"To: <akr@jaist.ac.jp>,=?ISO-2022-JP?B?GyRCJCIbKEI=?=<akr@jaist.ac.jp>"
+"To: <akr@jaist.ac.jp>,=?ISO-2022-JP?B?GyRCJCIbKEI=?=<akr@jaist.ac.jp>")
+
+(decode
+"To: <akr@jaist.ac.jp>,=?ISO-2022-JP?B?GyRCJCIbKEI=?=<akr@jaist.ac.jp>"
+"To: <akr@jaist.ac.jp>,\e$B$"\e(B<akr@jaist.ac.jp>"
+'permit-sticked-special)
+
+(decode
+"To: akr@jaist.ac.jp,=?ISO-2022-JP?B?GyRCJCIbKEI=?=<akr@jaist.ac.jp>"
+"To: akr@jaist.ac.jp,=?ISO-2022-JP?B?GyRCJCIbKEI=?=<akr@jaist.ac.jp>")
+
+(decode
+"To: akr@jaist.ac.jp,=?ISO-2022-JP?B?GyRCJCIbKEI=?=<akr@jaist.ac.jp>"
+"To: akr@jaist.ac.jp,\e$B$"\e(B<akr@jaist.ac.jp>"
+'permit-sticked-special)
+
+(decode
+"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=:akr@jaist.ac.jp;"
+"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=:akr@jaist.ac.jp;")
+
+(decode
+"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=:akr@jaist.ac.jp;"
+"To: \e$B$"\e(B:akr@jaist.ac.jp;"
+'permit-sticked-special)
+
+(decode
+"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=:=?ISO-2022-JP?B?GyRCJCQbKEI=?=<akr@jaist.ac.jp>;"
+"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=:=?ISO-2022-JP?B?GyRCJCQbKEI=?=<akr@jaist.ac.jp>;")
+
+(decode
+"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=:=?ISO-2022-JP?B?GyRCJCQbKEI=?=<akr@jaist.ac.jp>;"
+"To: \e$B$"\e(B:\e$B$$\e(B<akr@jaist.ac.jp>;"
+'ignore-76bytes-limit 'permit-sticked-special)
+
+(decode
+"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=:=?ISO-2022-JP?B?GyRCJCQbKEI=?=<foo@bar>,=?ISO-2022-JP?B?GyRCJCYbKEI=?=<foo@bar>;,=?ISO-2022-JP?B?GyRCJCgbKEI=?=<foo@bar>"
+"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=:=?ISO-2022-JP?B?GyRCJCQbKEI=?=<foo@bar>,=?ISO-2022-JP?B?GyRCJCYbKEI=?=<foo@bar>;,=?ISO-2022-JP?B?GyRCJCgbKEI=?=<foo@bar>")
+
+(decode
+"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=:=?ISO-2022-JP?B?GyRCJCQbKEI=?=<foo@bar>,=?ISO-2022-JP?B?GyRCJCYbKEI=?=<foo@bar>;,=?ISO-2022-JP?B?GyRCJCgbKEI=?=<foo@bar>"
+"To: \e$B$"\e(B:\e$B$$\e(B<foo@bar>,\e$B$&\e(B<foo@bar>;,\e$B$(\e(B<foo@bar>"
+'ignore-76bytes-limit 'permit-sticked-special)
+
+(decode
+"Subject:=?ISO-2022-JP?B?GyRCJCIbKEI=?="
+"Subject:=?ISO-2022-JP?B?GyRCJCIbKEI=?=")
+
+(decode
+"Subject:=?ISO-2022-JP?B?GyRCJCIbKEI=?="
+"Subject:\e$B$"\e(B"
+'permit-sticked-special)
+
+;; Section 4: Decoding invalid inputs.
+
+(decode
+"From: =?ISO-2022-JP?B?GyRCJCIbKEI=?==?ISO-2022-JP?B?GyRCJCQbKEI=?=
+ <akr@jaist.ac.jp>"
+"From: =?ISO-2022-JP?B?GyRCJCIbKEI=?==?ISO-2022-JP?B?GyRCJCQbKEI=?= <akr@jaist.ac.jp>")
+
+(decode
+"From: akr@jaist.ac.jp
+ (=?ISO-2022-JP?B?GyRCJCIbKEI=?=a=?ISO-2022-JP?B?GyRCJCQbKEI=?=)"
+"From: akr@jaist.ac.jp (=?ISO-2022-JP?B?GyRCJCIbKEI=?=a=?ISO-2022-JP?B?GyRCJCQbKEI=?=)")
+; FLAM
+
+(decode
+"From: akr@jaist.ac.jp
+ (=?ISO-2022-JP?B?GyRCJCIbKEI=?=(=?ISO-2022-JP?B?GyRCJCQbKEI=?=)=?ISO-2022-JP?B?GyRCJCYbKEI=?=)"
+"From: akr@jaist.ac.jp (=?ISO-2022-JP?B?GyRCJCIbKEI=?=(=?ISO-2022-JP?B?GyRCJCQbKEI=?=)=?ISO-2022-JP?B?GyRCJCYbKEI=?=)")
+; FLAM
+
+(decode
+"From: akr@jaist.ac.jp
+ (=?ISO-2022-JP?B?GyRCJCIbKEI=?=(=?ISO-2022-JP?B?GyRCJCQbKEI=?=)=?ISO-2022-JP?B?GyRCJCYbKEI=?=)"
+"From: akr@jaist.ac.jp (\e$B$"\e(B(\e$B$$\e(B)\e$B$&\e(B)"
+'ignore-76bytes-limit)
+
+(decode
+"Subject: =?=?ISO-2022-JP?B?GyRCJCIbKEI=?="
+"Subject: =?=?ISO-2022-JP?B?GyRCJCIbKEI=?=")
+
+(decode
+"Subject: =?ISO-2022-JP=?ISO-2022-JP?B?GyRCJCIbKEI=?="
+"Subject: =?ISO-2022-JP=?ISO-2022-JP?B?GyRCJCIbKEI=?=")
+
+(decode
+"Subject: =?ISO-2022-JP?=?ISO-2022-JP?B?GyRCJCIbKEI=?="
+"Subject: =?ISO-2022-JP?=?ISO-2022-JP?B?GyRCJCIbKEI=?=")
+
+(decode
+"Subject: =?ISO-2022-JP?B=?ISO-2022-JP?B?GyRCJCIbKEI=?="
+"Subject: =?ISO-2022-JP?B=?ISO-2022-JP?B?GyRCJCIbKEI=?=")
+
+(decode
+"Subject: =?ISO-2022-JP?B?=?ISO-2022-JP?B?GyRCJCIbKEI=?="
+"Subject: =?ISO-2022-JP?B?=?ISO-2022-JP?B?GyRCJCIbKEI=?=")
+
+(decode
+"Subject: =?ISO-2022-JP?B?GyRCJCIbKEI=?ISO-2022-JP?B?GyRCJCIbKEI=?="
+"Subject: =?ISO-2022-JP?B?GyRCJCIbKEI=?ISO-2022-JP?B?GyRCJCIbKEI=?=")
+
+(decode
+"Subject: =?ISO-2022-JP?B?GyRCJCIbKEI==?ISO-2022-JP?B?GyRCJCIbKEI=?="
+"Subject: =?ISO-2022-JP?B?GyRCJCIbKEI==?ISO-2022-JP?B?GyRCJCIbKEI=?=")
+
+(decode
+"Subject: =?ISO-2022-JP?B?GyRCJCIbKEI=?=?ISO-2022-JP?B?GyRCJCIbKEI=?="
+"Subject: =?ISO-2022-JP?B?GyRCJCIbKEI=?=?ISO-2022-JP?B?GyRCJCIbKEI=?=")
+
+(decode
+"Subject: =?ISO-2022-JP?B?GyRCJCIbKEI=?==?ISO-2022-JP?B?GyRCJCIbKEI=?="
+"Subject: =?ISO-2022-JP?B?GyRCJCIbKEI=?==?ISO-2022-JP?B?GyRCJCIbKEI=?=")
+
+(decode
+"Subject: =?ISO-2022-JP?B?GyRCJCIbKEI?="
+"Subject: =?ISO-2022-JP?B?GyRCJCIbKEI?=")
+
+(decode
+"Subject: =?ISO-2022-JP?B?GyRCNFg-dBsoQg==?="
+"Subject: =?ISO-2022-JP?B?GyRCNFg-dBsoQg==?=")
+
+;; Section 5: Encoding trivial inputs.
+
+(encode
+"From: \e$B$"\e(B <akr@jaist.ac.jp>"
+"From: =?ISO-2022-JP?B?GyRCJCIbKEI=?= <akr@jaist.ac.jp>")
+
+(encode
+"From: \"\e$B$"\e(B(\e$B$"\e(B)\" <akr@jaist.ac.jp>"
+"From: =?ISO-2022-JP?B?GyRCJCIbKEIoGyRCJCIbKEIp?= <akr@jaist.ac.jp>")
+; FLAM
+
+(encode
+"From: \"a\\\"b\e$B$"\e(Bc\\\\\" <akr@jaist.ac.jp>"
+"From: =?ISO-2022-JP?B?YSJiGyRCJCIbKEJjXA==?= <akr@jaist.ac.jp>")
+; FLAM
+
+(encode
+"Subject: \e$B0$\e(B                                                                                                                          \e$BR_\e(B"
+"Subject: =?ISO-2022-JP?B?GyRCMCQbKEIgICAgICAgICAgICAgICAgICAgICAgICAgICAg?=
+ =?US-ASCII?Q?____________________________________________________________?=
+ =?ISO-2022-JP?B?ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIBskQlJfGyhC?=")
+; FLAM
+
+(encode
+"Subject: \e$B0$\e(B                                                                                                                          \e$BR_\e(B"
+"Subject: =?ISO-2022-JP?B?GyQpQrCkICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICDS3w=="
+'ignore-76bytes-limit 'ignore-75bytes-limit)
+; FLAM
+
+(encode
+"From: \e.A\eN! <akr@jaist.ac.jp>"\e*B
+"From: =?ISO-8859-1?Q?=A1?= <akr@jaist.ac.jp>")
+
+(encode
+"From: \"abcdefghijklmnopqrst\e.A\eN!()\\\"\\\\\" <akr@jaist.ac.jp>"\e*B
+"From: =?ISO-8859-1?Q?abcdefghijklmnopqrst=A1=28=29=22=5C?= <akr@jaist.ac.jp>")
+; FLAM
+
+(encode
+"From: akr@jaist.ac.jp (abcdefghijklmnopqrst\e.A\eN!\\(\\)\"\\\\)"\e*B
+"From: akr@jaist.ac.jp (=?ISO-8859-1?Q?abcdefghijklmnopqrst=A1=28=29\"=5C?=)")
+; FLAM
+
+(encode
+"Subject: \e$B$"\e(B a \e.H\eN`"\e*B
+"Subject: =?ISO-2022-JP?B?GyRCJCIbKEI=?= a =?ISO-8859-8?Q?=E0?=")
+
+(encode
+"Subject: \e.H\eN`\e$BNm\e(B"\e*B
+"Subject: =?ISO-8859-8?Q?=E0?= =?ISO-2022-JP?B?GyRCTm0bKEI=?=")
+; FLAM
+
+(encode
+"Subject: \e.H\eN` \e$BNm\e(B"\e*B
+'("Subject: =?ISO-8859-8?Q?=E0_?= =?ISO-2022-JP?B?GyRCTm0bKEI=?="
+  "Subject: =?ISO-8859-8?Q?=E0?= =?ISO-2022-JP?B?IBskQk5tGyhC?="))
+
+(encode
+"Subject: \e.F\eNC\e$B4X?t\e(B"\e*B
+'("Subject: =?ISO-8859-7?Q?=C3?= =?ISO-2022-JP?B?GyRCNFg/dBsoQg==?="
+  "Subject: =?ISO-2022-JP-2?B?Gy5GG05DGyRCNFg/dBsoQg==?="))
+
+;; Section 6: Encoding melancholy inputs.
+
+(encode
+"From: akr@jaist.ac.jp (\e$B$"\e(B(\e$B$$\e(B)\e$B$&\e(B)"
+"From: akr@jaist.ac.jp
+ (=?ISO-2022-JP?B?GyRCJCIbKEI=?=(=?ISO-2022-JP?B?GyRCJCQbKEI=?=)=?ISO-2022-JP?B?GyRCJCYbKEI=?=)"
+'ignore-76bytes-limit)
+; FLAM
+
+(encode
+"From: akr@jaist.ac.jp (\e$B$"\e(B(\e$B$$\e(B)\e$B$&\e(B)"
+"From: akr@jaist.ac.jp (=?ISO-2022-JP?B?GyRCJCIbKEI=?=
+ =?ISO-2022-JP?B?GyhC?=(=?ISO-2022-JP?B?GyRCJCQbKEI=?=
+ =?ISO-2022-JP?B?GyhC?=)=?ISO-2022-JP?B?GyRCJCYbKEI=?=)"
+'zero-characters-encoded-word-hack)
+; FLAM
+
+(encode
+"From: \e$B$"\e(B(\e$B$"\e(B) <akr@jaist.ac.jp>"
+"From: =?ISO-2022-JP?B?GyRCJCIbKEIoGyRCJCIbKEIp?= <akr@jaist.ac.jp>"
+'encode-sticked-comment-as-atom)
+; FLAM
+
+(encode
+"From: \e$B$"\e(B(\e$B$"\e(B) <akr@jaist.ac.jp>"
+"From: =?ISO-2022-JP?B?GyRCJCIbKEI=?=(=?ISO-2022-JP?B?GyRCJCIbKEI=?=)
+ <akr@jaist.ac.jp>"
+'permit-sticked-comment)
+; FLAM
+
+(encode
+"From: \e$B$"\e(B(\e$B$"\e(B) <akr@jaist.ac.jp>"
+"From: =?ISO-2022-JP?B?GyRCJCIbKEI=?= (=?ISO-2022-JP?B?GyRCJCIbKEI=?=)
+ <akr@jaist.ac.jp>"
+'separate-sticked-comment)
+; FLAM
+
+(encode
+"To: \e$B$"\e(B<akr@jaist.ac.jp>"
+"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=<akr@jaist.ac.jp>"
+'permit-sticked-special)
+; FLAM
+
+(encode
+"To: \e$B$"\e(B<akr@jaist.ac.jp>"
+"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?= <akr@jaist.ac.jp>"
+'separate-sticked-special)
+
+(encode
+"To: <akr@jaist.ac.jp>,\e$B$"\e(B<akr@jaist.ac.jp>"
+"To: <akr@jaist.ac.jp>,=?ISO-2022-JP?B?GyRCJCIbKEI=?=<akr@jaist.ac.jp>"
+'permit-sticked-special)
+; FLAM
+
+(encode
+"To: <akr@jaist.ac.jp>,\e$B$"\e(B<akr@jaist.ac.jp>"
+"To: <akr@jaist.ac.jp>, =?ISO-2022-JP?B?GyRCJCIbKEI=?= <akr@jaist.ac.jp>"
+'separate-sticked-special)
+
+(encode
+"To: akr@jaist.ac.jp,\e$B$"\e(B<akr@jaist.ac.jp>"
+"To: akr@jaist.ac.jp,=?ISO-2022-JP?B?GyRCJCIbKEI=?=<akr@jaist.ac.jp>"
+'permit-sticked-special)
+; FLAM
+
+(encode
+"To: akr@jaist.ac.jp,\e$B$"\e(B<akr@jaist.ac.jp>"
+"To: akr@jaist.ac.jp, =?ISO-2022-JP?B?GyRCJCIbKEI=?= <akr@jaist.ac.jp>"
+'separate-sticked-special)
+
+(encode
+"To: \e$B$"\e(B:akr@jaist.ac.jp;"
+"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=:akr@jaist.ac.jp;"
+'permit-sticked-special)
+; FLAM
+
+(encode
+"To: \e$B$"\e(B:akr@jaist.ac.jp;"
+"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?= :akr@jaist.ac.jp;"
+'separate-sticked-special)
+; FLAM
+
+(encode
+"To: \e$B$"\e(B:\e$B$$\e(B<akr@jaist.ac.jp>;"
+"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=:=?ISO-2022-JP?B?GyRCJCQbKEI=?=<akr@jaist.ac.jp>;"
+'ignore-76bytes-limit 'permit-sticked-special)
+; FLAM
+
+(encode
+"To: \e$B$"\e(B:\e$B$$\e(B<akr@jaist.ac.jp>;"
+"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=:=?ISO-2022-JP?B?GyRCJCQbKEI=?=
+ =?ISO-2022-JP?B?GyhC?=<akr@jaist.ac.jp>;"
+'zero-characters-encoded-word-hack 'permit-sticked-special)
+; FLAM
+
+(encode
+"To: \e$B$"\e(B:\e$B$$\e(B<akr@jaist.ac.jp>;"
+"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?= : =?ISO-2022-JP?B?GyRCJCQbKEI=?=
+ <akr@jaist.ac.jp>;"
+'separate-sticked-special)
+; FLAM
+
+(encode
+"To: \e$B$"\e(B:\e$B$$\e(B<foo@bar>,\e$B$&\e(B<foo@bar>;,\e$B$(\e(B<foo@bar>"
+"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=:=?ISO-2022-JP?B?GyRCJCQbKEI=?=<foo@bar>,=?ISO-2022-JP?B?GyRCJCYbKEI=?=<foo@bar>;,=?ISO-2022-JP?B?GyRCJCgbKEI=?=<foo@bar>"
+'ignore-76bytes-limit 'permit-sticked-special)
+; FLAM
+
+(encode
+"To: \e$B$"\e(B:\e$B$$\e(B<foo@bar>,\e$B$&\e(B<foo@bar>;,\e$B$(\e(B<foo@bar>"
+"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=:=?ISO-2022-JP?B?GyRCJCQbKEI=?=
+ =?ISO-2022-JP?B?GyhC?=<foo@bar>,=?ISO-2022-JP?B?GyRCJCYbKEI=?=
+ =?ISO-2022-JP?B?GyhC?=<foo@bar>;,=?ISO-2022-JP?B?GyRCJCgbKEI=?=<foo@bar>"
+'zero-characters-encoded-word-hack 'permit-sticked-special)
+; FLAM
+
+(encode
+"To: \e$B$"\e(B:\e$B$$\e(B<foo@bar>,\e$B$&\e(B<foo@bar>;,\e$B$(\e(B<foo@bar>"
+"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?= : =?ISO-2022-JP?B?GyRCJCQbKEI=?=
+ <foo@bar>, =?ISO-2022-JP?B?GyRCJCYbKEI=?= <foo@bar>;,
+ =?ISO-2022-JP?B?GyRCJCgbKEI=?= <foo@bar>"
+'separate-sticked-special)
+; FLAM
+
+;; Section 7: Using quoted-encoded-words.
+;
+;; quoted-encoded-word \e$BI=8=\e(B
 ; 
 ; RFC2047 \e$B$N%G%3!<%@$O@x:_E*$K\e(B(\e$B%G%3!<%I7k2L$G$J$/\e(B) encoded-word \e$B$=$N$b$N$r\e(B
 ; \e$B=PNO$7$J$1$l$P$J$i$J$$$3$H$,$"$k!#\e(B
 ;  =?US-ASCII?Q?=3D=3FUS-ASCII=3FQ=3Ftext=3F=3D?=
 ;
 ; \e$B%G%3!<%@$,C1$J$kJ8;zNs$r=PNO$9$k>l9g!"C1=c$K$d$k$H\e(B encoded-word \e$B$=$N$b$N$H\e(B
-; encoded-word \e$B$r6hJL$G$-$J$$!#\e(B
+; encoded-word \e$B$N$h$&$K$_$($kJ8;zNs$r6hJL$G$-$J$$!#\e(B
 ; \e$B$3$3$G$OJ8;zNsCf$G$=$l$i$r3N<B$K6hJL$7$FI=8=$9$kJ}K!$r<($9!#\e(B
 ;
 ; rule 1: \e$BJ8;zNsCf$G\e(B =?charset?encoding?text?= \e$B$H$$$&%Q%?!<%s$K\e(B
 ;
 ; NOTE: '*' \e$B$r\e(B quoted-encoded-word \e$BI=8=$N\e(B quote \e$BJ8;z$H8F$V!#\e(B
 ;
-; NOTE: \e$B8=;~E@$G\e(B IANA \e$B$N%l%8%9%H%j$K$O\e(B '*' \e$B$r4^$`\e(B charset \e$B$O\e(B
-;  \e$BEPO?$5$l$F$$$J$$$N$G!"EPO?$5$l$F$$$k\e(B charset \e$B$r;H$C$?\e(B encoded-word \e$B$r\e(B
-;  \e$BI=8=$9$k$K$O\e(B '*' \e$B$r\e(B 1\e$B$D$D$1$k$3$H$K$J$k!#\e(B
+; NOTE: \e$B8=;~E@\e(B(1998/07/19)\e$B$G\e(B IANA \e$B$N%l%8%9%H%j$K$O\e(B '*' \e$B$r4^$`\e(B charset \e$B$O\e(B
+;  \e$BEPO?$5$l$F$$$J$$$N$G!"$=$l$i$N\e(B charset \e$B$r;H$C$?\e(B
+;  encoded-word \e$B$rI=8=$9$k$K$O\e(B '*' \e$B$r\e(B 1\e$B$D$D$1$k$3$H$K$J$k!#\e(B
 ;
 ;  =?US-ASCII?Q?abcdef?= \e$B$H$$$&\e(Bencoded-word : =?*US-ASCII?Q?abcdef?=
 ;
 ;  =?*US-ASCII?Q?abcdef?= \e$B$H$$$&J8;zNs\e(B       : =?**US-ASCII?Q?abcdef?=
 ;  =?**US-ASCII?Q?abcdef?= \e$B$H$$$&J8;zNs\e(B     : =?****US-ASCII?Q?abcdef?=
 ;  =?***US-ASCII?Q?abcdef?= \e$B$H$$$&J8;zNs\e(B    : =?******US-ASCII?Q?abcdef?=
+;  =?US-ASCII*?Q?abcdef?= \e$B$H$$$&J8;zNs\e(B      : =?US-ASCII*?Q?abcdef?=
+;  =?U*S-ASCII?Q?abcdef?= \e$B$H$$$&J8;zNs\e(B      : =?U*S-ASCII?Q?abcdef?=
+;
+; NOTE: encoded-word \e$B$K8+$($kJ8;zNs$G\e(B '*' \e$B$,G\A}$5$l$k$N$O\e(B charset \e$B$N\e(B
+;  \e$B@hF,$@$1$G$"$j!"\e(Bencoding \e$B$d\e(B encoded-text \e$B$O$?$H$(\e(B '*' \e$B$,F~$C$F$$$F$b\e(B
+;  \e$BJQ2=$7$J$$!#$^$?!"\e(Bcharset \e$BCf$G$b\e(B \e$B@hF,0J30$N\e(B '*' \e$B$OJQ2=$7$J$$!#\e(B
 ;
 ; rule 3: \e$BJ8;zNsA4BN$NFbMF$O!"\e(Brule 1 \e$B$H\e(B rule 2 \e$B$G2r<a$7$?3FItJ,$N\e(B
 ;   \e$BJ8;zNs$rC1=c$KO"7k$7$?J8;zNs$H$9$k!#\e(B
 ;
 ; NOTE: RFC2047 \e$B$G$O\e(B encoded-word \e$B$,6uGr$G6h@Z$i$l$J$1$l$P$J$i$J$$$H$+!"\e(B
+;  encoded-word \e$B$O\e(B 75bytes \e$B0J2<$G$J$1$l$P$J$i$J$$$H$+!"\e(B
 ;  encoded-word \e$B$,4^$^$l$k9T$O\e(B 76bytes \e$B0J2<$G$J$1$l$P$J$i$J$$$J$I$H$$$&\e(B
 ;  \e$B5,Ls$,$"$k$,!"\e(Bquoted-encoded-word \e$BI=8=$G$O$=$l$i$O:NMQ$7$J$$!#\e(B
 ;  \e$BC1=c$K\e(B encoded-word \e$BFbIt$NJ8K!$@$1$rMxMQ$9$k!#\e(B
-;  (\e$BK\<AE*$K$O0[$J$kJ8K!$r:NMQ$9$k$3$H$b2DG=$G$"$k!#\e(B)
+;  (\e$BK\<AE*$K$O0[$J$kJ8K!$r:NMQ$9$k$3$H$b2DG=$G$"$k$,!"\e(BRFC2047 \e$B$K7I0U$r\e(B
+;  \e$BI=$7$F\e(B encoded-word \e$B$NJ8K!$r:NMQ$9$k!#\e(B)
 ;
 ; NOTE: quoted-encoded-word \e$BI=8=$7$?J8;zNs$NO"7k$O0BA4$G$O$J$$!#\e(B
 ;  =?*US-ASCII?Q?ab \e$B$H\e(B cd?= \e$B$H$$$&\e(B quoted-encoded-word \e$BI=8=$7$?J8;zNs$O\e(B
 ;  \e$B$3$l$O$H$/$K\e(B Non ASCII \e$B3HD%\e(B RFC822 \e$B$NCf$K\e(B quoted-encoded-word \e$BI=8=$r\e(B
 ;  \e$BKd$a9~$`$H$-$K5$$rIU$1$J$1$l$P$J$i$J$$!#\e(B(\e$BKd$a9~$s$@7k2L$O@5$7$$\e(B
 ;  quoted-encoded-word \e$BI=8=$H$O$J$i$J$$$+$bCN$l$J$$!#\e(B)
-;
 
 (decode
 "Subject: =?Unknown-Charset?B?gqA=?="
 "Subject: =?*Unknown-Charset?B?gqA=?="
 'quoted-encoded-word)
-; FLIM-FLAM
+; FLAM
+
+(decode
+"Subject: =?US-ASCII?G?H4sIAMsIsjUCA0tMSk5JTQMA7zmOSwYAAAA?="
+"Subject: =?*US-ASCII?G?H4sIAMsIsjUCA0tMSk5JTQMA7zmOSwYAAAA?="
+'quoted-encoded-word)
+; FLAM
+
+(decode
+"Subject: =?US-ASCII?Unknown-Encoding?H4sIAMsIsjUCA0tMSk5JTQMA7zmOSwYAAAA?="
+"Subject: =?*US-ASCII?Unknown-Encoding?H4sIAMsIsjUCA0tMSk5JTQMA7zmOSwYAAAA?="
+'quoted-encoded-word)
+; FLAM
 
 (decode
 "Subject: =?Unknown-Charset?B?gqA=?= =?Unknown-Charset?B?gqA=?="
 "Subject: =?*Unknown-Charset?B?gqA=?==?*Unknown-Charset?B?gqA=?="
 'quoted-encoded-word)
-; FLIM-FLAM
+; FLAM
 
 (decode
 "Subject: =?Unknown-Charset?B?gqA=?=  =?Unknown-Charset?B?gqA=?="
 "Subject: =?*Unknown-Charset?B?gqA=?==?*Unknown-Charset?B?gqA=?="
 'quoted-encoded-word)
-; FLIM-FLAM
+; FLAM
 
 (decode
 "Subject: =?Unknown-Charset?B?gqA=?=
  =?Unknown-Charset?B?gqA=?="
 "Subject: =?*Unknown-Charset?B?gqA=?==?*Unknown-Charset?B?gqA=?="
 'quoted-encoded-word)
-; FLIM-FLAM
+; FLAM
 
 (decode
 "Subject: =?Unknown-Charset?B?gqA=?=
        =?Unknown-Charset?B?gqA=?="
 "Subject: =?*Unknown-Charset?B?gqA=?==?*Unknown-Charset?B?gqA=?="
 'quoted-encoded-word)
-; FLIM-FLAM
+; FLAM
 
 (decode
 "Subject: a=?Unknown-Charset?B?gqA=?="
 "Subject: a=?Unknown-Charset?B?gqA=?="
 'quoted-encoded-word)
-; FLIM-FLAM
 
 (decode
 "Subject: =?Unknown-Charset?B?gqA=?=b"
 "Subject: =?Unknown-Charset?B?gqA=?=b"
 'quoted-encoded-word)
-; FLIM-FLAM
 
 (decode
 "Subject: a=?Unknown-Charset?B?gqA=?=b"
 "Subject: a=?Unknown-Charset?B?gqA=?=b"
 'quoted-encoded-word)
-; FLIM-FLAM
 
 (decode
 "Subject: a =?Unknown-Charset?B?gqA=?= b"
 "Subject: a =?*Unknown-Charset?B?gqA=?= b"
 'quoted-encoded-word)
-; FLIM-FLAM
+; FLAM
 
 (decode
 "Subject: =?ISO-2022-JP?B?DQoNCg==?="
 "Subject: =?*US-ASCII?Q?=0D=0A=0D=0A?="
 'quoted-encoded-word)
-; FLIM-FLAM
+; FLAM
 
 (decode
 "Subject: =?US-ASCII?Q?a=0D=0A_b?="
 "Subject: a=?*US-ASCII?Q?=0D=0A?= b"
 'quoted-encoded-word)
-; FLIM-FLAM
+; FLAM
 
 ;;;end-test;;;
 
+(report)
+
 ;----------------------------------------------------------------------------