* test-elmo-util.el (test-elmo-object-save-1): New testcase.
[elisp/wanderlust.git] / tests / test-elmo-util.el
1 (require 'lunit)
2 (require 'elmo-util)
3
4
5 (luna-define-class test-elmo-util (lunit-test-case))
6
7 ;; setup & teardown
8 (defvar test-elmo-temoporary-file)
9
10 (luna-define-method lunit-test-case-setup ((case test-elmo-util))
11   (setq test-elmo-temoporary-file
12         (make-temp-file temporary-file-directory)))
13
14 (luna-define-method lunit-test-case-teardown ((case test-elmo-util))
15   (delete-file test-elmo-temoporary-file))
16
17
18 (luna-define-method test-elmo-replace-string-as-filename-1 ((case test-elmo-util))
19   (lunit-assert
20    (let ((str "/foo//./../bar/"))
21      (string= str
22               (elmo-recover-string-from-filename
23                (elmo-replace-string-as-filename str))))))
24
25
26 (luna-define-method test-elmo-object-save-1 ((case test-elmo-util))
27   (let ((list '(1 2 3 4 5 6 7 8 9 10 11 12))
28         (print-length 1)
29         (print-level 1))
30     (elmo-object-save test-elmo-temoporary-file list)
31     (lunit-assert
32      (equal list
33             (elmo-object-load test-elmo-temoporary-file)))))