From: kaoru Date: Sat, 1 Aug 2009 09:40:15 +0000 (+0000) Subject: * test-elmo-imap4.el: New file. X-Git-Tag: elmo-imap4-compliance-root~84 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=59dc980716e004e7ea74377ab2624fc7ffacd8e2;p=elisp%2Fwanderlust.git * test-elmo-imap4.el: New file. (test-elmo-imap4-parse-greeting-ok): New testcase. (test-elmo-imap4-parse-greeting-preauth): Ditto. (test-elmo-imap4-parse-greeting-bye): Ditto. --- diff --git a/tests/ChangeLog b/tests/ChangeLog index ade64ef..9f8c6ed 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,5 +1,10 @@ 2009-08-01 TAKAHASHI Kaoru + * test-elmo-imap4.el: New file. + (test-elmo-imap4-parse-greeting-ok): New testcase. + (test-elmo-imap4-parse-greeting-preauth): Ditto. + (test-elmo-imap4-parse-greeting-bye): Ditto. + * test-utf7.el (toplevel): Use `fboundp' instead of `boundp'. Fix (require 'utf7) order for Mule-UCS. (test-utf7-decode-string-plus): New testcase. diff --git a/tests/test-elmo-imap4.el b/tests/test-elmo-imap4.el new file mode 100644 index 0000000..bbb824e --- /dev/null +++ b/tests/test-elmo-imap4.el @@ -0,0 +1,33 @@ +(require 'lunit) +(require 'elmo-imap4) + +(luna-define-class test-elmo-imap4 (lunit-test-case)) + +(luna-define-method test-elmo-imap4-parse-greeting-ok ((case test-elmo-imap4)) + (with-temp-buffer + (setq case-fold-search nil) + (let (elmo-imap4-status) + (insert-string "* OK [CAPABILITY IMAP4 IMAP4rev1 LITERAL+ ID" + " LOGINDISABLED AUTH=DIGEST-MD5 AUTH=CRAM-MD5 SASL-IR]" + " mail.example.org Cyrus IMAP v2.3.13 server ready\n") + (goto-char (point-min)) + (lunit-assert + (eq 'nonauth (elmo-imap4-parse-greeting)))))) + +(luna-define-method test-elmo-imap4-parse-greeting-preauth ((case test-elmo-imap4)) + (with-temp-buffer + (setq case-fold-search nil) + (let (elmo-imap4-status) + (insert-string "* PREAUTH IMAP4rev1 server logged in as Smith\n") + (goto-char (point-min)) + (lunit-assert + (eq 'auth (elmo-imap4-parse-greeting)))))) + +(luna-define-method test-elmo-imap4-parse-greeting-bye ((case test-elmo-imap4)) + (with-temp-buffer + (setq case-fold-search nil) + (let (elmo-imap4-status) + (insert-string "* BYE LOGOUT received\n") + (goto-char (point-min)) + (lunit-assert + (eq 'closed (elmo-imap4-parse-greeting))))))