From bc21f72a1251fc896bfdc827e9e17a47ce2cc4f5 Mon Sep 17 00:00:00 2001 From: okazaki Date: Sat, 26 Feb 2005 16:37:17 +0000 Subject: [PATCH] (test-elmo-list-diff): New testcase. --- tests/ChangeLog | 4 ++++ tests/test-elmo-util.el | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/tests/ChangeLog b/tests/ChangeLog index 014c925..96ba0f7 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,7 @@ +2005-02-27 Tetsurou Okazaki + + * test-elmo-util.el (test-elmo-list-diff): New testcase. + 2004-10-11 Hiroya Murata * test-elmo-util.el (test-elmo-number-set-delete-1): New testcase. diff --git a/tests/test-elmo-util.el b/tests/test-elmo-util.el index 457a011..73a05df 100644 --- a/tests/test-elmo-util.el +++ b/tests/test-elmo-util.el @@ -94,6 +94,40 @@ ;;; (equal '(1 2 "3" 5 4) ;;; (elmo-list-insert '(1 2 "3" 5) 4 "3")) +(luna-define-method test-elmo-list-diff ((case test-elmo-util)) + (let ((list1 '(1 2 3)) + (list2 '(1 2 3 4)) + (list3 '(1 2 4)) + (list4 '(4 5 6)) + (list5 '(3 4 5 6))) + (lunit-assert + (equal '(nil nil) + (elmo-list-diff nil nil))) + (lunit-assert + (equal '(nil (1 2 3)) + (elmo-list-diff nil list1))) + (lunit-assert + (equal '((1 2 3) nil) + (elmo-list-diff list1 nil))) + (lunit-assert + (equal '(nil nil) + (elmo-list-diff list1 list1))) + (lunit-assert + (equal '(nil (4)) + (elmo-list-diff list1 list2))) + (lunit-assert + (equal '((3) (4)) + (elmo-list-diff list1 list3))) + (lunit-assert + (equal '((3 2 1) (6 5 4)) + (elmo-list-diff list1 list4))) + (lunit-assert + (equal '((2 1) (6 5)) + (elmo-list-diff list3 list4))) + (lunit-assert + (equal '((2 1) (6 5 3)) + (elmo-list-diff list3 list5))))) + (luna-define-method test-elmo-delete-char-1 ((case test-elmo-util)) (lunit-assert (string= "f" (elmo-delete-char ?o "foo"))) -- 1.7.10.4