From d0c118242556256c12ecedbb76adcc9ea85790e0 Mon Sep 17 00:00:00 2001 From: "Thomas M. Hermann" Date: Mon, 26 Nov 2012 16:40:33 -0600 Subject: [PATCH] Clean up the equality predicates. --- lisp-unit.lisp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lisp-unit.lisp b/lisp-unit.lisp index 133acd1..0f2ffd9 100644 --- a/lisp-unit.lisp +++ b/lisp-unit.lisp @@ -761,18 +761,18 @@ assertion.") ;;; Useful equality predicates for tests -;;; (LOGICALLY-EQUAL x y) => true or false -;;; Return true if x and y both false or both true (defun logically-equal (x y) + "Return true if x and y are both false or both true." (eql (not x) (not y))) -;;; (SET-EQUAL l1 l2 :test) => true or false -;;; Return true if every element of l1 is an element of l2 -;;; and vice versa. -(defun set-equal (l1 l2 &key (test #'equal)) - (and (listp l1) - (listp l2) - (subsetp l1 l2 :test test) - (subsetp l2 l1 :test test))) +(defun set-equal (list1 list2 &rest initargs &key key (test #'equal)) + "Return true if every element of list1 is an element of list2 and +vice versa." + (declare (ignore key test)) + (and + (listp list1) + (listp list2) + (apply #'subsetp list1 list2 initargs) + (apply #'subsetp list2 list1 initargs))) (pushnew :lisp-unit common-lisp:*features*) -- 2.11.4.GIT