From: kaoru Date: Thu, 19 Feb 2004 09:09:33 +0000 (+0000) Subject: New testcases. Add docstring. X-Git-Tag: wl-2_11_25~54 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c79d571fb0f3e5800f03ac4a65f1c1a2c6992aed;p=elisp%2Fwanderlust.git New testcases. Add docstring. --- diff --git a/tests/ChangeLog b/tests/ChangeLog index 1f4c68b..4f803ff 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -5,10 +5,12 @@ (lunit-test-case-teardown): Check file existence before remove. (test-elmo-object-save-2, test-elmo-save-string-1) (test-elmo-uniq-list-1, test-elmo-uniq-list-2) - (test-elmo-uniq-list-delq) - (test-elmo-list-insert-1, test-elmo-list-insert-2) - (test-elmo-delete-char-1, test-elmo-concat-path-1) - (test-elmo-remove-passwd-1): New testcases. + (test-elmo-uniq-list-3, test-elmo-list-insert-1) + (test-elmo-list-insert-2, test-elmo-delete-char-1) + (test-elmo-concat-path-1) + (test-elmo-remove-passwd-1, test-elmo-remove-passwd-2) + (test-elmo-remove-passwd-3, test-elmo-passwd-alist-clear-1): New + testcases. Add docstring. 2004-02-18 TAKAHASHI Kaoru diff --git a/tests/test-elmo-util.el b/tests/test-elmo-util.el index 5bdd214..a044358 100644 --- a/tests/test-elmo-util.el +++ b/tests/test-elmo-util.el @@ -22,6 +22,7 @@ (luna-define-method test-elmo-replace-string-as-filename-1 ((case test-elmo-util)) + "Revert checking replace and recover." (lunit-assert (let ((str "/foo//./../bar/")) (string= str @@ -31,14 +32,18 @@ ;; object save & load (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))) + "Check `print-length' let bindings." + (let ((list '(1 2 3 4 5 6 7 8 9 10 11 12)) + (print-length 1)) (elmo-object-save test-elmo-temoporary-file list) (lunit-assert (equal list (elmo-object-load test-elmo-temoporary-file))))) (luna-define-method test-elmo-object-save-2 ((case test-elmo-util)) - (let ((list '(1 (2 :foo (nil . :bar))))) + "Check `print-level' let bindings." + (let ((list '(1 (2 :foo (nil . :bar)))) + (print-level 1)) (elmo-object-save test-elmo-temoporary-file list) (lunit-assert (equal list @@ -65,7 +70,8 @@ (lunit-assert (equal '("foo") (elmo-uniq-list '("foo" "foo"))))) -(luna-define-method test-elmo-uniq-list-delq ((case test-elmo-util)) +(luna-define-method test-elmo-uniq-list-3 ((case test-elmo-util)) + "Check using DELETE-FUNCTION" (lunit-assert (equal '("foo" "foo") (elmo-uniq-list '("foo" "foo") #'delq))) (lunit-assert @@ -84,6 +90,7 @@ ) (luna-define-method test-elmo-list-insert-2 ((case test-elmo-util)) + "Check not copied" (let* ((list1 '(1 2 3 4 5)) (list2 list1)) (elmo-list-insert list1 4 3) @@ -115,10 +122,46 @@ (luna-define-method test-elmo-remove-passwd-1 ((case test-elmo-util)) + "Check shred password." (let* ((password "cGFzc3dk") (elmo-passwd-alist (list (cons "key" password)))) (elmo-remove-passwd "key") (lunit-assert - (string= "\0\0\0\0\0\0\0\0" password)) + (string= "\0\0\0\0\0\0\0\0" password)))) + +(luna-define-method test-elmo-remove-passwd-2 ((case test-elmo-util)) + "Check remove target pair only. Not rassoc." + (let ((password "cGFzc3dk") + (elmo-passwd-alist '(("foo" . "key") + ("key" . "ok") + ("bar" . "baz")))) + (elmo-remove-passwd "key") + (lunit-assert + (equal '(("foo" . "key") + ("bar" . "baz")) + elmo-passwd-alist)))) + +(luna-define-method test-elmo-remove-passwd-3 ((case test-elmo-util)) + "Multiple same key." + (let ((password "cGFzc3dk") + (elmo-passwd-alist '(("foo" . "key") + ("key" . "ok") + ("key" . "ok2") + ("bar" . "baz")))) + (elmo-remove-passwd "key") + (lunit-assert + (equal '(("foo" . "key") + ("bar" . "baz")) + elmo-passwd-alist)))) + +(luna-define-method test-elmo-passwd-alist-clear-1 ((case test-elmo-util)) + "Check shred ALL password." + (let* ((password1 "cGFzc3dk") + (password2 (copy-sequence password1)) + (elmo-passwd-alist (list (cons "key1" password1) + (cons "key2" password2)))) + (elmo-passwd-alist-clear) + (lunit-assert + (string= "\0\0\0\0\0\0\0\0" password1)) (lunit-assert - (null elmo-passwd-alist)))) + (string= "\0\0\0\0\0\0\0\0" password2))))