From: akr Date: Mon, 20 Jul 1998 11:14:19 +0000 (+0000) Subject: TESTPAT: add test. X-Git-Tag: flam-199811302358~8 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1e7b07e2c2beddbf4dcc60f87c6b761c432d35d9;p=elisp%2Fflim.git TESTPAT: add test. --- diff --git a/ChangeLog b/ChangeLog index 290a87a..0f819a9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +1998-07-20 Tanaka Akira + + * TESTPAT: add test. + 1998-07-20 MORIOKA Tomohiko * mime-def.el (mime-library-version-string): Renamed from @@ -219,7 +223,7 @@ 1998-07-07 MORIOKA Tomohiko - * FLIM-Chao: Version 1.8.0 (Shij-Dò)-A was released. + * FLIM-Chao: Version 1.8.0 (Shij.DNr) was released.*B 1998-07-07 MORIOKA Tomohiko @@ -331,7 +335,7 @@ 1998-07-01 MORIOKA Tomohiko - * FLIM: Version 1.8.0 (-DÒkubo)-A was released. + * FLIM: Version 1.8.0 (.DNRkubo) was released.*B * README.en: Delete `How to use'. @@ -456,7 +460,7 @@ 1998-06-28 MORIOKA Tomohiko - * FLIM-Chao: Version 1.7.0 (Goj-Dò)-A was released. + * FLIM-Chao: Version 1.7.0 (Goj.DNr) was released.*B 1998-06-26 MORIOKA Tomohiko @@ -715,7 +719,7 @@ 1998-06-19 MORIOKA Tomohiko - * FLIM: Version 1.4.1 (Momoyama-Gory-Dòmae)-A was released. + * FLIM: Version 1.4.1 (Momoyama-Gory.DNrmae) was released.*B 1998-06-18 MORIOKA Tomohiko @@ -835,7 +839,7 @@ 1998-05-06 MORIOKA Tomohiko - * FLIM: Version 1.2.0 (J-Dþjò)-A was released. + * FLIM: Version 1.2.0 (J.DN~jNr) was released.*B * README.en (What's FLIM): Delete description about std11-parse.el; add description about mailcap.el. @@ -886,7 +890,7 @@ 1998-05-05 MORIOKA Tomohiko - * FLIM: Version 1.1.0 (T-Dòji)-A was released. + * FLIM: Version 1.1.0 (T.DNrji) was released.*B 1998-05-04 MORIOKA Tomohiko @@ -922,7 +926,7 @@ 1998-04-17 MORIOKA Tomohiko - * FLIM: Version 1.0.1 (Ky-Dòto)-A was released. + * FLIM: Version 1.0.1 (Ky.DNrto) was released.*B * mime-def.el (mime-spadework-module-version-string): New constant. diff --git a/TESTPAT b/TESTPAT index 37ed743..0df9c1e 100644 --- a/TESTPAT +++ b/TESTPAT @@ -3,46 +3,17 @@ ;---------------------------------------------------------------------------- ; options: -;encode-sticked-comment-as-atom ; violate policy preventing structure -;ignore-75bytes-limit ; violate RFC2047 -;ignore-76bytes-limit ; violate RFC2047 -;permit-sticked-comment ; violate RFC2047 -;permit-sticked-special ; violate RFC2047 -;separate-sticked-comment ; violate policy preserving absence of space -;separate-sticked-special ; violate policy preserving absence of space -;zero-characters-encoded-word-hack ; violate common sense (very tricky) -;quoted-encoded-word ; violate character sequence semantics - -;;; test driver for FLAM (and FLIM) - -(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) - (with-temp-buffer - (insert src "\n" mail-header-separator) - (eword-decode-header 'us-ascii mail-header-separator) - (goto-char (point-min)) - (std11-narrow-to-header mail-header-separator) - (std11-field-end) - (let ((result (buffer-substring (point-min) (point)))) - (if (member result dsts) t result)))) - -(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) - (with-temp-buffer - (insert src "\n" mail-header-separator) - (goto-char (point-min)) - (eword-encode-header 'us-ascii) - (goto-char (point-min)) - (std11-narrow-to-header mail-header-separator) - (std11-field-end) - (let ((result (buffer-substring (point-min) (point)))) - (if (member result dsts) t result)))) +;encode-sticked-comment-as-atom ; violate the policy preserving structures +;ignore-75bytes-limit ; violate RFC2047 +;ignore-76bytes-limit ; violate RFC2047 +;permit-sticked-comment ; violate RFC2047 +;permit-sticked-special ; violate RFC2047 +;separate-sticked-comment ; violate the policy preserving absence of space +;separate-sticked-special ; violate the policy preserving absence of space +;zero-characters-encoded-word-hack ; violate common sense (very tricky) +;quoted-encoded-word ; violate character sequence semantics + +;;; test driver (setq decode-test 'decode-flam) (setq encode-test 'encode-flam) @@ -56,8 +27,10 @@ (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))) + (progn + (setq decode-succ-count (1+ decode-succ-count)) + (insert "\n'dsucc")) + (insert (format "\n%S\n'dfail" res))) res)) (setq encode-succ-count 0) @@ -69,8 +42,10 @@ (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))) + (progn + (setq encode-succ-count (1+ encode-succ-count)) + (insert "\n'esucc")) + (insert (format "\n%S\n'efail" res))) res)) (defun report () @@ -79,8 +54,38 @@ decode-succ-count decode-all-count encode-succ-count encode-all-count))) -;;;start-test;;; +;;; FLAM specific part (FLIM is OK) +(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) + (with-temp-buffer + (insert src "\n" mail-header-separator) + (eword-decode-header 'us-ascii mail-header-separator) + (goto-char (point-min)) + (std11-narrow-to-header mail-header-separator) + (std11-field-end) + (let ((result (buffer-substring (point-min) (point)))) + (if (member result dsts) t result)))) + +(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) + (with-temp-buffer + (insert src "\n" mail-header-separator) + (goto-char (point-min)) + (eword-encode-header 'us-ascii) + (goto-char (point-min)) + (std11-narrow-to-header mail-header-separator) + (std11-field-end) + (let ((result (buffer-substring (point-min) (point)))) + (if (member result dsts) t result)))) + +;;;start-test;;; ;; Section 1: Decoding examples from RFC2047 @@ -113,7 +118,6 @@ "From: Nathaniel Borenstein (=?iso-8859-8?b?7eXs+SDv4SDp7Oj08A==?=)" "From: Nathaniel Borenstein (.HNmNeNlNy NoNa NiNlNhNtNp)")*B -; FLAM (decode "From: foo@bar.baz (=?ISO-8859-1?Q?a?=)" @@ -225,7 +229,6 @@ (decode "From: < =?ISO-2022-JP?B?GyRCJCIbKEI=?= @jaist.ac.jp>" "From: < =?ISO-2022-JP?B?GyRCJCIbKEI=?= @jaist.ac.jp>") -; FLAM (decode "From: =?ISO-2022-JP?Q?=1B=24BAA=1B=28B?= " @@ -416,18 +419,20 @@ "Subject: =?ISO-2022-JP?B?GyRCJCIbKEI=?==" "Subject: =?ISO-2022-JP?B?GyRCJCIbKEI=?==") +(decode +"From: akr@jaist.ac.jp (\\=?ISO-2022-JP?B?GyRCJCIbKEI=?=)" +"From: akr@jaist.ac.jp (\\=?ISO-2022-JP?B?GyRCJCIbKEI=?=)") + ;; Section 3: Decoding melancholy inputs. (decode "From:=?ISO-2022-JP?B?GyRCJCIbKEI=?= " "From:=?ISO-2022-JP?B?GyRCJCIbKEI=?= ") -; FLAM (decode "From: akr@jaist.ac.jp (=?ISO-2022-JP?B?GyRCJCIbKEI=?=\\a=?ISO-2022-JP?B?GyRCJCQbKEI=?=)" "From: akr@jaist.ac.jp ($B$"(B\\a$B$$(B)") -; FLAM (decode "From: (a)=?ISO-2022-JP?B?GyRCJCIbKEI=?= " @@ -548,13 +553,11 @@ "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 @@ -615,25 +618,21 @@ (encode "From: \"$B$"(B($B$"(B)\" " "From: =?ISO-2022-JP?B?GyRCJCIbKEIoGyRCJCIbKEIp?= ") -; FLAM (encode "From: \"a\\\"b$B$"(Bc\\\\\" " "From: =?ISO-2022-JP?B?YSJiGyRCJCIbKEJjXA==?= ") -; FLAM (encode "Subject: $B0$(B $BR_(B" "Subject: =?ISO-2022-JP?B?GyRCMCQbKEIgICAgICAgICAgICAgICAgICAgICAgICAgICAg?= =?US-ASCII?Q?____________________________________________________________?= =?ISO-2022-JP?B?ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIBskQlJfGyhC?=") -; FLAM (encode "Subject: $B0$(B $BR_(B" "Subject: =?ISO-2022-JP?B?GyQpQrCkICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICDS3w==" 'ignore-76bytes-limit 'ignore-75bytes-limit) -; FLAM (encode "From: .AN! "*B @@ -642,12 +641,10 @@ (encode "From: \"abcdefghijklmnopqrst.AN!()\\\"\\\\\" "*B "From: =?ISO-8859-1?Q?abcdefghijklmnopqrst=A1=28=29=22=5C?= ") -; FLAM (encode "From: akr@jaist.ac.jp (abcdefghijklmnopqrst.AN!\\(\\)\"\\\\)"*B "From: akr@jaist.ac.jp (=?ISO-8859-1?Q?abcdefghijklmnopqrst=A1=28=29\"=5C?=)") -; FLAM (encode "Subject: $B$"(B a .HN`"*B @@ -656,7 +653,6 @@ (encode "Subject: .HN`$BNm(B"*B "Subject: =?ISO-8859-8?Q?=E0?= =?ISO-2022-JP?B?GyRCTm0bKEI=?=") -; FLAM (encode "Subject: .HN` $BNm(B"*B @@ -675,7 +671,6 @@ "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 ($B$"(B($B$$(B)$B$&(B)" @@ -683,33 +678,28 @@ =?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: $B$"(B($B$"(B) " "From: =?ISO-2022-JP?B?GyRCJCIbKEIoGyRCJCIbKEIp?= " 'encode-sticked-comment-as-atom) -; FLAM (encode "From: $B$"(B($B$"(B) " "From: =?ISO-2022-JP?B?GyRCJCIbKEI=?=(=?ISO-2022-JP?B?GyRCJCIbKEI=?=) " 'permit-sticked-comment) -; FLAM (encode "From: $B$"(B($B$"(B) " "From: =?ISO-2022-JP?B?GyRCJCIbKEI=?= (=?ISO-2022-JP?B?GyRCJCIbKEI=?=) " 'separate-sticked-comment) -; FLAM (encode "To: $B$"(B" "To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=" 'permit-sticked-special) -; FLAM (encode "To: $B$"(B" @@ -720,7 +710,6 @@ "To: ,$B$"(B" "To: ,=?ISO-2022-JP?B?GyRCJCIbKEI=?=" 'permit-sticked-special) -; FLAM (encode "To: ,$B$"(B" @@ -731,7 +720,6 @@ "To: akr@jaist.ac.jp,$B$"(B" "To: akr@jaist.ac.jp,=?ISO-2022-JP?B?GyRCJCIbKEI=?=" 'permit-sticked-special) -; FLAM (encode "To: akr@jaist.ac.jp,$B$"(B" @@ -742,39 +730,33 @@ "To: $B$"(B:akr@jaist.ac.jp;" "To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=:akr@jaist.ac.jp;" 'permit-sticked-special) -; FLAM (encode "To: $B$"(B:akr@jaist.ac.jp;" "To: =?ISO-2022-JP?B?GyRCJCIbKEI=?= :akr@jaist.ac.jp;" 'separate-sticked-special) -; FLAM (encode "To: $B$"(B:$B$$(B;" "To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=:=?ISO-2022-JP?B?GyRCJCQbKEI=?=;" 'ignore-76bytes-limit 'permit-sticked-special) -; FLAM (encode "To: $B$"(B:$B$$(B;" "To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=:=?ISO-2022-JP?B?GyRCJCQbKEI=?= =?ISO-2022-JP?B?GyhC?=;" 'zero-characters-encoded-word-hack 'permit-sticked-special) -; FLAM (encode "To: $B$"(B:$B$$(B;" "To: =?ISO-2022-JP?B?GyRCJCIbKEI=?= : =?ISO-2022-JP?B?GyRCJCQbKEI=?= ;" 'separate-sticked-special) -; FLAM (encode "To: $B$"(B:$B$$(B,$B$&(B;,$B$((B" "To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=:=?ISO-2022-JP?B?GyRCJCQbKEI=?=,=?ISO-2022-JP?B?GyRCJCYbKEI=?=;,=?ISO-2022-JP?B?GyRCJCgbKEI=?=" 'ignore-76bytes-limit 'permit-sticked-special) -; FLAM (encode "To: $B$"(B:$B$$(B,$B$&(B;,$B$((B" @@ -782,7 +764,6 @@ =?ISO-2022-JP?B?GyhC?=,=?ISO-2022-JP?B?GyRCJCYbKEI=?= =?ISO-2022-JP?B?GyhC?=;,=?ISO-2022-JP?B?GyRCJCgbKEI=?=" 'zero-characters-encoded-word-hack 'permit-sticked-special) -; FLAM (encode "To: $B$"(B:$B$$(B,$B$&(B;,$B$((B" @@ -790,7 +771,6 @@ , =?ISO-2022-JP?B?GyRCJCYbKEI=?= ;, =?ISO-2022-JP?B?GyRCJCgbKEI=?= " 'separate-sticked-special) -; FLAM ;; Section 7: Using quoted-encoded-words. ; @@ -821,18 +801,18 @@ ; $B%^%C%A$7$J$$ItJ,$O$=$NItJ,$N$^$^$NFbMF$rI=$9!#(B ; ; rule 2: $BJ8;zNsCf$G(B =?charset?encoding?text?= $B$H$$$&%Q%?!<%s$K(B -; $B%^%C%A$9$kItJ,$O(B charset $B$N@hF,$K(B '*' $B$,$$$/$DIU$$$F$$$k$+$GFbMF$N(B +; $B%^%C%A$9$kItJ,$O(B charset $B$N@hF,$K(B * $B$,$$$/$DIU$$$F$$$k$+$GFbMF$N(B ; $B2rl9g(B(0, 2, 4, ...): charset $B$N@hF,$N(B '*' $B$N?t$rH>J,$K$7$?J8;zNs(B -; $B4q?t$N>l9g(B(1, 3, 5, ...): charset $B$N@hF,$N(B '*' $B$N?t$rH>J,(B($B>.?tE@0J2<(B +; $B6v?t$N>l9g(B(0, 2, 4, ...): charset $B$N@hF,$N(B * $B$N?t$rH>J,$K$7$?J8;zNs(B +; $B4q?t$N>l9g(B(1, 3, 5, ...): charset $B$N@hF,$N(B * $B$N?t$rH>J,(B($B>.?tE@0J2<(B ; $B@Z