From: kaoru Date: Wed, 18 Feb 2004 15:32:03 +0000 (+0000) Subject: * test-elmo-util.el (test-elmo-object-save-1): New testcase. X-Git-Tag: wl-2_11_25~59 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bba381e0ffa443d7e6a17751cb50f477662b890e;p=elisp%2Fwanderlust.git * test-elmo-util.el (test-elmo-object-save-1): New testcase. (lunit-test-case-setup, lunit-test-case-teardown): Add temporary-file stuff. --- diff --git a/tests/ChangeLog b/tests/ChangeLog index 57c3dbd..2c6941f 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,5 +1,9 @@ 2004-02-18 TAKAHASHI Kaoru + * test-elmo-util.el (test-elmo-object-save-1): New testcase. + (lunit-test-case-setup, lunit-test-case-teardown): Add + temporary-file stuff. + * test-elmo-localdir.el (test-elmo-folder-expand-msgdb-path-4): New testcase. (test-elmo-folder-expand-msgdb-path-2): Change order. diff --git a/tests/test-elmo-util.el b/tests/test-elmo-util.el index 96fe6fc..0bc877e 100644 --- a/tests/test-elmo-util.el +++ b/tests/test-elmo-util.el @@ -1,11 +1,33 @@ (require 'lunit) (require 'elmo-util) + (luna-define-class test-elmo-util (lunit-test-case)) +;; setup & teardown +(defvar test-elmo-temoporary-file) + +(luna-define-method lunit-test-case-setup ((case test-elmo-util)) + (setq test-elmo-temoporary-file + (make-temp-file temporary-file-directory))) + +(luna-define-method lunit-test-case-teardown ((case test-elmo-util)) + (delete-file test-elmo-temoporary-file)) + + (luna-define-method test-elmo-replace-string-as-filename-1 ((case test-elmo-util)) (lunit-assert (let ((str "/foo//./../bar/")) (string= str (elmo-recover-string-from-filename (elmo-replace-string-as-filename str)))))) + + +(luna-define-method test-elmo-object-save-1 ((case test-elmo-util)) + (let ((list '(1 2 3 4 5 6 7 8 9 10 11 12)) + (print-length 1) + (print-level 1)) + (elmo-object-save test-elmo-temoporary-file list) + (lunit-assert + (equal list + (elmo-object-load test-elmo-temoporary-file)))))