X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Flist.pure.lisp;h=555b0c2b0948395fb5c32e04da531a9a47ae8dd6;hb=ed891a4fd882d1b9fe066ab14bcf2107aea95baa;hp=921500df3113d90e6da840e3e68f253a054fc1b8;hpb=f24a665895283c52443ed45bb3e07530f760bbfa;p=sbcl.git diff --git a/tests/list.pure.lisp b/tests/list.pure.lisp index 921500d..555b0c2 100644 --- a/tests/list.pure.lisp +++ b/tests/list.pure.lisp @@ -262,3 +262,22 @@ (declare (optimize speed)) (adjoin elt '(:y)))) ':x))) + + +(macrolet ((test (expected list-1 list-2 &rest args) + `(progn + (assert (equal ,expected (funcall #'union ,list-1 ,list-2 ,@args))) + (assert (equal ,expected (funcall #'nunion + (copy-list ,list-1) + (copy-list ,list-2) + ,@args)))))) + (test nil nil nil) + (test '(42) nil '(42)) + (test '(42) '(42) nil) + (test '(42) '(42) '(42)) + (test '((42) (42)) '((42)) '((42))) + (test '((42) (42)) '((42)) '((42)) :test-not #'equal) + (test '((42)) '((42)) '((42)) :test #'equal) + (test '((42)) '((42)) '((42)) :key #'car) + (test '((42)) '((42)) '((42)) :key #'car :test-not #'<)) +