diff options
Diffstat (limited to 'test/lisp/mail')
| -rw-r--r-- | test/lisp/mail/rfc2047-tests.el | 38 |
1 files changed, 26 insertions, 12 deletions
diff --git a/test/lisp/mail/rfc2047-tests.el b/test/lisp/mail/rfc2047-tests.el index 8f7b345e71e..bfaf9958917 100644 --- a/test/lisp/mail/rfc2047-tests.el +++ b/test/lisp/mail/rfc2047-tests.el | |||
| @@ -22,25 +22,39 @@ | |||
| 22 | (require 'ert) | 22 | (require 'ert) |
| 23 | (require 'rfc2047) | 23 | (require 'rfc2047) |
| 24 | 24 | ||
| 25 | (ert-deftest test-rfc2047-fold-short () | 25 | (defun test-rfc2047 (before after) |
| 26 | (with-temp-buffer | 26 | (with-temp-buffer |
| 27 | (insert "Organization: Lots Of Short Words Here Lots Of Short Words Here Lots Of Short Words Here\n") | 27 | (insert before) |
| 28 | (goto-char (point-min)) | 28 | (goto-char (point-min)) |
| 29 | (rfc2047-fold-field) | 29 | (rfc2047-fold-field) |
| 30 | (should (equal (buffer-string) | 30 | (should (equal (buffer-string) after)))) |
| 31 | "Organization: Lots Of Short Words Here Lots Of Short Words Here Lots Of | 31 | |
| 32 | (ert-deftest test-rfc2047-fold-short () | ||
| 33 | (test-rfc2047 | ||
| 34 | "Organization: Lots Of Short Words Here Lots Of Short Words Here Lots Of Short Words Here\n" | ||
| 35 | |||
| 36 | "Organization: Lots Of Short Words Here Lots Of Short Words Here Lots Of | ||
| 32 | Short Words Here | 37 | Short Words Here |
| 33 | ")))) | 38 | ")) |
| 34 | 39 | ||
| 35 | (ert-deftest test-rfc2047-fold-encoded () | 40 | (ert-deftest test-rfc2047-fold-encoded () |
| 36 | (with-temp-buffer | 41 | (test-rfc2047 |
| 37 | (insert "Subject: This is =?utf-8?Q?=C3=A1?= long subject that's =?utf-8?Q?v=C3=A9ry?= long and =?utf-8?Q?ver=C3=BD?= encoded yes indeed it =?utf-8?Q?=C3=ADs?=\n") | 42 | "Subject: This is =?utf-8?Q?=C3=A1?= long subject that's =?utf-8?Q?v=C3=A9ry?= long and =?utf-8?Q?ver=C3=BD?= encoded yes indeed it =?utf-8?Q?=C3=ADs?=\n" |
| 38 | (goto-char (point-min)) | 43 | "Subject: This is =?utf-8?Q?=C3=A1?= long subject that's |
| 39 | (rfc2047-fold-field) | ||
| 40 | (should (equal (buffer-string) | ||
| 41 | "Subject: This is =?utf-8?Q?=C3=A1?= long subject that's | ||
| 42 | =?utf-8?Q?v=C3=A9ry?= long and =?utf-8?Q?ver=C3=BD?= encoded yes indeed it | 44 | =?utf-8?Q?v=C3=A9ry?= long and =?utf-8?Q?ver=C3=BD?= encoded yes indeed it |
| 43 | =?utf-8?Q?=C3=ADs?= | 45 | =?utf-8?Q?=C3=ADs?= |
| 44 | ")))) | 46 | ")) |
| 47 | |||
| 48 | (ert-deftest test-rfc2047-fold-long () | ||
| 49 | (test-rfc2047 | ||
| 50 | "Organization: verylongverylongverylongverylongverylongverylongverylongverylongverylongword and then\n" | ||
| 51 | "Organization: verylongverylongverylongverylongverylongverylongverylongverylongverylongword | ||
| 52 | and then | ||
| 53 | ")) | ||
| 54 | |||
| 55 | (ert-deftest test-rfc2047-fold-long-short () | ||
| 56 | (test-rfc2047 | ||
| 57 | "Organization: verylongverylongverylongverylongverylongverylongverylongverylongverylongword\n" | ||
| 58 | "Organization: verylongverylongverylongverylongverylongverylongverylongverylongverylongword\n")) | ||
| 45 | 59 | ||
| 46 | ;;; rfc2047-tests.el ends here | 60 | ;;; rfc2047-tests.el ends here |