cons-test-19.lsp 17.3 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12
;-*- Mode:     Lisp -*-
;;;; Author:   Paul Dietz
;;;; Created:  Sat Mar 28 11:53:33 1998
;;;; Contains: Testing of CL Features related to "CONS", part 19

(in-package :cl-test)
(use-package :rt)
(declaim (optimize (safety 3)))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; intersection

13 14
(deftest intersection.1
  (intersection nil nil)
15 16
  nil)

17 18
(deftest intersection.2
  (intersection (loop for i from 1 to 100 collect i) nil)
19 20
  nil)

21 22
(deftest intersection.3
  (intersection nil (loop for i from 1 to 100 collect i))
23 24
  nil)

25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
(deftest intersection.4
  (let* ((x (copy-list '(a 1 c 7 b 4 3 z)))
	 (xcopy (make-scaffold-copy x))
	 (y (copy-list '(3 y c q z a 18)))
	 (ycopy (make-scaffold-copy y))
	 (result (intersection x y)))
    (and
     (check-scaffold-copy x xcopy)
     (check-scaffold-copy y ycopy)
     (+
      (loop
       for e in x count
       (and (member e y)
	    (not (member e result))))
      (loop
       for e in result count
       (or (not (member e x))
	   (not (member e y))))
      (loop
       for hd on result count
       (and (consp hd)
	    (member (car hd) (cdr hd)))))))
47 48
  0)

49 50 51 52 53 54 55 56 57 58 59
(deftest intersection.5
  (let* ((x (copy-list '(a a a)))
	 (xcopy (make-scaffold-copy x))
	 (y (copy-list '(a a a b b b)))
	 (ycopy (make-scaffold-copy y))
	 (result (intersection x y)))
    (and
     (check-scaffold-copy x xcopy)
     (check-scaffold-copy y ycopy)
     (member 'a result)
     (not (member 'b result))))
60 61
  t)

62 63 64
(deftest intersection.6
  (intersection (list 1000000000000 'a 'b 'c)
		(list (1+ 999999999999) 'd 'e 'f))
65 66
  (1000000000000))

67 68 69
(deftest intersection.7
  (intersection (list 'a 10 'b 17)
		(list 'c 'd 4 'e 'f 10 1 13 'z))
70 71
  (10))

72 73 74
(deftest intersection.8
  (intersection (list 'a (copy-seq "aaa") 'b)
		(list 'd (copy-seq "aaa") 'e))
75 76
  nil)

77 78 79 80
(deftest intersection.9
  (intersection (list 'a (copy-seq "aaa") 'b)
		(list 'd (copy-seq "aaa") 'e)
		:test #'equal)
81 82 83
  ("aaa"))

;; Same as 9, but with a symbol function designator for :test
84 85 86 87
(deftest intersection.9-a
  (intersection (list 'a (copy-seq "aaa") 'b)
		(list 'd (copy-seq "aaa") 'e)
		:test 'equal)
88 89
  ("aaa"))

90 91 92 93
(deftest intersection.9-b
  (intersection (list 'a (copy-seq "aaa") 'b)
		(list 'd (copy-seq "aaa") 'e)
		:test-not #'(lambda (p q) (not (equal p q))))
94 95
  ("aaa"))

96
(deftest intersection.10
97 98 99 100 101 102 103 104 105 106
  (equalt
   (sort
    (intersection (loop
		   for i from 0 to 1000 by 3
		   collect i)
		  (loop
		   for i from 0 to 1000 by 7
		   collect i))
    #'<)
   (loop for i from 0 to 1000 by 21 collect i))
107 108
  t)

109
(deftest intersection.11
110 111 112 113 114 115 116 117 118 119 120 121 122
  (equalt
   (sort
    (intersection (loop
		   for i from 0 to 999 by 5
		   collect i)
		  (loop
		   for i from 0 to 999 by 7
		   collect i)
		  :test #'(lambda (a b)
			    (and (eql a b)
				 (= (mod a 3) 0))))
    #'<)
   (loop for i from 0 to 999 by (* 3 5 7) collect i))
123 124
  t)

125
(deftest intersection.11-a
126 127 128 129 130 131 132 133 134 135 136 137 138 139
  (equalt
   (sort
    (intersection (loop
		   for i from 0 to 999 by 5
		   collect i)
		  (loop
		   for i from 0 to 999 by 7
		   collect i)
		  :test-not
		  #'(lambda (a b)
		      (not (and (eql a b)
				(= (mod a 3) 0)))))
    #'<)
   (loop for i from 0 to 999 by (* 3 5 7) collect i))
140 141 142 143 144 145
  t)

;;
;; Do large numbers of random intersection tests
;;

146 147
(deftest intersection.12
  (intersection-12-body 100 100)
148 149 150 151 152 153 154
  nil)


;;
;; :key argument
;;

155
(deftest intersection.13
156 157 158 159 160
  (let ((x (copy-list '(0 5 8 13 31 42)))
	(y (copy-list '(3 5 42 0 7 100 312 33))))
    (equalt
     (sort (copy-list (intersection x y)) #'<)
     (sort (copy-list (intersection x y :key #'1+)) #'<)))
161 162 163
  t)

;; Same as 13, but with a symbol function designator for :key
164
(deftest intersection.13-a
165 166 167 168 169
  (let ((x (copy-list '(0 5 8 13 31 42)))
	(y (copy-list '(3 5 42 0 7 100 312 33))))
    (equalt
     (sort (copy-list (intersection x y)) #'<)
     (sort (copy-list (intersection x y :key '1+)) #'<)))
170 171 172 173
  t)

;; Test that a nil key argument is ignored

174
(deftest intersection.14
175 176 177 178 179 180 181 182 183
  (let
      ((result (intersection (copy-list '(a b c d))
			     (copy-list '(e c f b g))
			     :key nil)))
    (and
     (member 'b result)
     (member 'c result)
     (every #'(lambda (x) (member x '(b c))) result)
     t))
184 185 186 187
  t)

;; Test that intersection preserves the order of arguments to :test, :test-not

188
(deftest intersection.15
189 190 191 192 193 194 195 196 197
  (let ((list1 (list 1 2 3 4))
	(list2 (list 4 5 6 7)))
    (block fail
      (intersection
       list1 list2
       :test
       #'(lambda (x y)
	   (when (< y x) (return-from fail 'fail))
	   (eql x y)))))
198 199
  (4))

200
(deftest intersection.16
201 202 203 204 205 206 207 208 209 210
  (let ((list1 (list 1 2 3 4))
	(list2 (list 4 5 6 7)))
    (block fail
      (intersection
       list1 list2
       :key #'identity
       :test
       #'(lambda (x y)
	   (when (< y x) (return-from fail 'fail))
	   (eql x y)))))
211 212
  (4))

213
(deftest intersection.17
214 215 216 217 218 219 220 221 222
  (let ((list1 (list 1 2 3 4))
	(list2 (list 4 5 6 7)))
    (block fail
      (intersection
       list1 list2
       :test-not
       #'(lambda (x y)
	   (when (< y x) (return-from fail 'fail))
	   (not (eql x y))))))
223 224
  (4))

225
(deftest intersection.18
226 227 228 229 230 231 232 233 234 235
  (let ((list1 (list 1 2 3 4))
	(list2 (list 4 5 6 7)))
    (block fail
      (intersection
       list1 list2
       :key #'identity
       :test-not
       #'(lambda (x y)
	   (when (< y x) (return-from fail 'fail))
	   (not (eql x y))))))
236 237
  (4))

238 239
;;; Order of argument evaluation tests

240
(deftest intersection.order.1
241 242 243 244 245 246 247
  (let ((i 0) x y)
    (values
     (intersection (progn (setf x (incf i)) (list 'a 'b))
		   (progn (setf y (incf i)) (list 'c 'd)))
     i x y))
  nil 2 1 2)

248
(deftest intersection.order.2
249 250 251 252 253 254 255 256
  (let ((i 0) x y)
    (values
     (intersection (progn (setf x (incf i)) (list 'a 'b))
		   (progn (setf y (incf i)) (list 'c 'd))
		   :test #'eq)
     i x y))
  nil 2 1 2)

257
(deftest intersection.order.3
258 259 260 261 262 263 264 265 266 267
  (let ((i 0) x y z w)
    (values
     (intersection (progn (setf x (incf i)) (list 'a 'b))
		   (progn (setf y (incf i)) (list 'c 'd))
		   :test (progn (setf z (incf i)) #'eq)
		   :test (progn (setf w (incf i))
				(complement #'eq)))
     i x y z w))
  nil 4 1 2 3 4)

268
(deftest intersection.order.4
269 270 271 272 273 274 275 276 277
  (let ((i 0) x y z w)
    (values
     (intersection (progn (setf x (incf i)) (list 'a 'b))
		   (progn (setf y (incf i)) (list 'c 'd))
		   :test (progn (setf z (incf i)) #'eq)
		   :key (progn (setf w (incf i)) #'identity))
     i x y z w))
  nil 4 1 2 3 4)

278
(deftest intersection.order.5
279 280 281 282 283 284 285 286 287 288
  (let ((i 0) x y z w)
    (values
     (intersection (progn (setf x (incf i)) (list 'a 'b))
		   (progn (setf y (incf i)) (list 'c 'd))
		   :key (progn (setf z (incf i)) #'identity)
		   :test (progn (setf w (incf i)) #'eq))
     i x y z w))
  nil 4 1 2 3 4)


289 290 291
;;; Keyword tests

(deftest intersection.allow-other-keys.1
292 293 294 295 296
  (let ((list1 (list 1 2 3 4))
	(list2 (list 4 5 6 7)))
    (intersection list1 list2 :bad t :allow-other-keys 1))
  (4))

297
(deftest intersection.allow-other-keys.2
298 299 300 301 302
  (let ((list1 (list 1 2 3 4))
	(list2 (list 4 5 6 7)))
    (intersection list1 list2 :allow-other-keys :foo :also-bad t))
  (4))

303
(deftest intersectionallow-other-keys.3
304 305 306 307 308 309
  (let ((list1 (list 1 2 3 4))
	(list2 (list 4 5 6 7)))
    (intersection list1 list2 :allow-other-keys :foo :also-bad t
		  :test #'(lambda (x y) (= x (1+ y)))))
  nil)

310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350
(deftest intersection.allow-other-keys.4
  (let ((list1 (list 1 2 3 4))
	(list2 (list 4 5 6 7)))
    (intersection list1 list2 :allow-other-keys t))
  (4))

(deftest intersection.allow-other-keys.5
  (let ((list1 (list 1 2 3 4))
	(list2 (list 4 5 6 7)))
    (intersection list1 list2 :allow-other-keys nil))
  (4))

(deftest intersection.allow-other-keys.6
  (let ((list1 (list 1 2 3 4))
	(list2 (list 4 5 6 7)))
    (intersection list1 list2 :allow-other-keys t
		  :allow-other-keys nil :bad t))
  (4))

(deftest intersection.allow-other-keys.7
  (sort
   (let ((list1 (list 1 2 3 4))
	 (list2 (list 4 5 6 7)))
     (intersection list1 list2 :allow-other-keys t
		   :allow-other-keys nil
		   :test #'(lambda (x y) (eql x (1- y)))))
   #'<)
  (3 4))

(deftest intersection.keywords.8
  (sort
   (let ((list1 (list 1 2 3 4))
	 (list2 (list 4 5 6 7)))
     (intersection list1 list2
		   :test #'(lambda (x y) (eql x (1- y)))
		   :test #'eql))
   #'<)
  (3 4))

;;; Error tests

351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374
(deftest intersection.error.1
  (classify-error (intersection))
  program-error)

(deftest intersection.error.2
  (classify-error (intersection nil))
  program-error)

(deftest intersection.error.3
  (classify-error (intersection nil nil :bad t))
  program-error)

(deftest intersection.error.4
  (classify-error (intersection nil nil :key))
  program-error)

(deftest intersection.error.5
  (classify-error (intersection nil nil 1 2))
  program-error)

(deftest intersection.error.6
  (classify-error (intersection nil nil :bad t :allow-other-keys nil))
  program-error)

375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390
(deftest intersection.error.7
  (classify-error (intersection '(a b c) '(d e f) :test #'identity))
  program-error)

(deftest intersection.error.8
  (classify-error (intersection '(a b c) '(d e f) :test-not #'identity))
  program-error)

(deftest intersection.error.9
  (classify-error (intersection '(a b c) '(d e f) :key #'cons))
  program-error)

(deftest intersection.error.10
  (classify-error (intersection '(a b c) '(d e f) :key #'car))
  type-error)

391 392 393
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; nintersection

394
(deftest nintersection.1
395
  (nintersection nil nil)
396 397
  nil)

398
(deftest nintersection.2
399
  (nintersection (loop for i from 1 to 100 collect i) nil)
400 401
  nil)

402
(deftest nintersection.3
403
  (nintersection-with-check nil (loop for i from 1 to 100 collect i))
404 405
  nil)

406
(deftest nintersection.4
407 408 409 410 411 412 413 414 415 416 417 418 419 420 421
  (let* ((x (copy-list '(a 1 c 7 b 4 3 z)))
	 (xc (copy-list x))
	 (y (copy-list '(3 y c q z a 18)))
	 (result (nintersection-with-check xc y)))
    (and
     (not (eqt result 'failed))
     (+
      (loop for e in x count
	    (and (member e y)
		 (not (member e result))))
      (loop for e in result count
	    (or (not (member e x)) (not (member e y))))
      (loop for hd on result count
	    (and (consp hd)
		 (member (car hd) (cdr hd)))))))
422 423
  0)

424
(deftest nintersection.5
425 426 427 428 429 430 431
  (let* ((x (copy-list '(a a a)))
	 (y (copy-list '(a a a b b b)))
	 (result (nintersection-with-check x y)))
    (and
     (not (eqt result 'failed))
     (member 'a result)
     (not (member 'b result))))
432 433
  t)

434
(deftest nintersection.6
435 436 437
  (nintersection-with-check
   (list 1000000000000 'a 'b 'c)
   (list (1+ 999999999999) 'd 'e 'f))
438 439
  (1000000000000))

440
(deftest nintersection.7
441 442
  (nintersection-with-check (list 'a 10 'b 17)
			    (list 'c 'd 4 'e 'f 10 1 13 'z))
443 444
  (10))

445
(deftest nintersection.8
446 447 448
  (nintersection-with-check
   (list 'a (copy-seq "aaa") 'b)
   (list 'd (copy-seq "aaa") 'e))
449 450
  nil)

451
(deftest nintersection.9
452 453 454 455
  (nintersection-with-check
   (list 'a (copy-seq "aaa") 'b)
   (list 'd (copy-seq "aaa") 'e)
   :test #'equal)
456 457
  ("aaa"))

458
(deftest nintersection.9-a
459 460 461 462
  (nintersection-with-check
   (list 'a (copy-seq "aaa") 'b)
   (list 'd (copy-seq "aaa") 'e)
   :test 'equal)
463 464
  ("aaa"))

465
(deftest nintersection.9-b
466 467 468 469
  (nintersection
   (list 'a (copy-seq "aaa") 'b)
   (list 'd (copy-seq "aaa") 'e)
   :test-not #'(lambda (p q) (not (equal p q))))
470 471
  ("aaa"))

472
(deftest nintersection.10
473 474 475 476 477 478 479 480 481
  (equalt
   (sort
    (let ((result
	   (nintersection-with-check
	    (loop for i from 0 to 1000 by 3 collect i)
	    (loop for i from 0 to 1000 by 7 collect i))))
      (if (eqt result 'failed) () result))
    #'<)
   (loop for i from 0 to 1000 by 21 collect i))
482 483
  t)

484
(deftest nintersection.11
485 486 487 488 489 490 491 492 493 494 495 496 497
  (equalt
   (sort
    (let ((result
	   (nintersection-with-check
	    (loop for i from 0 to 999 by 5 collect i)
	    (loop for i from 0 to 999 by 7 collect i)
	    :test #'(lambda (a b)
		      (and (eql a b)
			   (= (mod a 3) 0))))))
      (if (eqt result 'failed) () result))
    #'<)
   (loop
    for i from 0 to 999 by (* 3 5 7) collect i))
498 499
  t)

500
(deftest nintersection.12
501
  (nintersection-12-body 100 100)
502 503 504 505
  nil)

;; Key argument

506
(deftest nintersection.13
507 508 509 510 511 512 513
  (let ((x '(0 5 8 13 31 42))
	(y (copy-list '(3 5 42 0 7 100 312 33))))
    (equalt
     (sort (copy-list (nintersection
		       (copy-list x) y)) #'<)
     (sort (copy-list (nintersection
		       (copy-list x) y :key #'1+)) #'<)))
514 515 516 517
  t)

;; Check that a nil key argument is ignored

518
(deftest nintersection.14
519 520 521 522 523 524 525 526 527 528
  (let
      ((result (nintersection
		(copy-list '(a b c d))
		(copy-list '(e c f b g))
		:key nil)))
    (and
     (member 'b result)
     (member 'c result)
     (every #'(lambda (x) (member x '(b c))) result)
     t))
529 530 531 532
  t) 

;; Test that nintersection preserves the order of arguments to :test, :test-not

533
(deftest nintersection.15
534 535 536 537 538 539 540 541 542
  (let ((list1 (list 1 2 3 4))
	(list2 (list 4 5 6 7)))
    (block fail
      (nintersection
       list1 list2
       :test
       #'(lambda (x y)
	   (when (< y x) (return-from fail 'fail))
	   (eql x y)))))
543 544
  (4))

545
(deftest nintersection.16
546 547 548 549 550 551 552 553 554 555
  (let ((list1 (list 1 2 3 4))
	(list2 (list 4 5 6 7)))
    (block fail
      (nintersection
       list1 list2
       :key #'identity
       :test
       #'(lambda (x y)
	   (when (< y x) (return-from fail 'fail))
	   (eql x y)))))
556 557
  (4))

558
(deftest nintersection.17
559 560 561 562 563 564 565 566 567
  (let ((list1 (list 1 2 3 4))
	(list2 (list 4 5 6 7)))
    (block fail
      (nintersection
       list1 list2
       :test-not
       #'(lambda (x y)
	   (when (< y x) (return-from fail 'fail))
	   (not (eql x y))))))
568 569
  (4))

570
(deftest nintersection.18
571 572 573 574 575 576 577 578 579 580
  (let ((list1 (list 1 2 3 4))
	(list2 (list 4 5 6 7)))
    (block fail
      (nintersection
       list1 list2
       :key #'identity
       :test-not
       #'(lambda (x y)
	   (when (< y x) (return-from fail 'fail))
	   (not (eql x y))))))
581
  (4))
582

583 584
;;; Order of argument evaluation tests

585
(deftest nintersection.order.1
586 587 588 589 590 591 592
  (let ((i 0) x y)
    (values
     (nintersection (progn (setf x (incf i)) (list 'a 'b))
		   (progn (setf y (incf i)) (list 'c 'd)))
     i x y))
  nil 2 1 2)

593
(deftest nintersection.order.2
594 595 596 597 598 599 600 601
  (let ((i 0) x y)
    (values
     (nintersection (progn (setf x (incf i)) (list 'a 'b))
		   (progn (setf y (incf i)) (list 'c 'd))
		   :test #'eq)
     i x y))
  nil 2 1 2)

602
(deftest nintersection.order.3
603 604 605 606 607 608 609 610 611 612
  (let ((i 0) x y z w)
    (values
     (nintersection (progn (setf x (incf i)) (list 'a 'b))
		   (progn (setf y (incf i)) (list 'c 'd))
		   :test (progn (setf z (incf i)) #'eq)
		   :test (progn (setf w (incf i))
				(complement #'eq)))
     i x y z w))
  nil 4 1 2 3 4)

613
(deftest nintersection.order.4
614 615 616 617 618 619 620 621 622
  (let ((i 0) x y z w)
    (values
     (nintersection (progn (setf x (incf i)) (list 'a 'b))
		   (progn (setf y (incf i)) (list 'c 'd))
		   :test (progn (setf z (incf i)) #'eq)
		   :key (progn (setf w (incf i)) #'identity))
     i x y z w))
  nil 4 1 2 3 4)

623
(deftest nintersection.order.5
624 625 626 627 628 629 630 631 632
  (let ((i 0) x y z w)
    (values
     (nintersection (progn (setf x (incf i)) (list 'a 'b))
		   (progn (setf y (incf i)) (list 'c 'd))
		   :key (progn (setf z (incf i)) #'identity)
		   :test (progn (setf w (incf i)) #'eq))
     i x y z w))
  nil 4 1 2 3 4)

633 634 635
;;; Keyword tests

(deftest nintersection.allow-other-keys.1
636 637 638 639 640
  (let ((list1 (list 1 2 3 4))
	(list2 (list 4 5 6 7)))
    (nintersection list1 list2 :bad t :allow-other-keys 1))
  (4))

641
(deftest nintersection.allow-other-keys.2
642 643 644 645 646
  (let ((list1 (list 1 2 3 4))
	(list2 (list 4 5 6 7)))
    (nintersection list1 list2 :allow-other-keys :foo :also-bad t))
  (4))

pfdietz's avatar
pfdietz committed
647
(deftest nintersection.allow-other-keys.3
648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693
  (let ((list1 (list 1 2 3 4))
	(list2 (list 4 5 6 7)))
    (nintersection list1 list2 :allow-other-keys :foo :also-bad t
		  :test #'(lambda (x y) (= x (1+ y)))))
  nil)

(deftest nintersection.allow-other-keys.4
  (let ((list1 (list 1 2 3 4))
	(list2 (list 4 5 6 7)))
    (nintersection list1 list2 :allow-other-keys t))
  (4))

(deftest nintersection.allow-other-keys.5
  (let ((list1 (list 1 2 3 4))
	(list2 (list 4 5 6 7)))
    (nintersection list1 list2 :allow-other-keys nil))
  (4))

(deftest nintersection.allow-other-keys.6
  (let ((list1 (list 1 2 3 4))
	(list2 (list 4 5 6 7)))
    (nintersection list1 list2 :allow-other-keys t
		  :allow-other-keys nil :bad t))
  (4))

(deftest nintersection.allow-other-keys.7
  (sort
   (let ((list1 (list 1 2 3 4))
	 (list2 (list 4 5 6 7)))
     (nintersection list1 list2 :allow-other-keys t
		   :allow-other-keys nil
		   :test #'(lambda (x y) (eql x (1- y)))))
   #'<)
  (3 4))

(deftest nintersection.keywords.8
  (sort
   (let ((list1 (list 1 2 3 4))
	 (list2 (list 4 5 6 7)))
     (nintersection list1 list2
		   :test #'(lambda (x y) (eql x (1- y)))
		   :test #'eql))
   #'<)
  (3 4))

(deftest nintersection.allow-other-keys.9
694 695 696 697 698 699
  (let ((list1 (list 1 2 3 4))
	(list2 (list 4 5 6 7)))
    (nintersection list1 list2 :allow-other-keys :foo :also-bad t
		  :test #'(lambda (x y) (= x (1+ y)))))
  nil)

700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721
(deftest nintersection.error.1
  (classify-error (nintersection))
  program-error)

(deftest nintersection.error.2
  (classify-error (nintersection nil))
  program-error)

(deftest nintersection.error.3
  (classify-error (nintersection nil nil :bad t))
  program-error)

(deftest nintersection.error.4
  (classify-error (nintersection nil nil :key))
  program-error)

(deftest nintersection.error.5
  (classify-error (nintersection nil nil 1 2))
  program-error)

(deftest nintersection.error.6
  (classify-error (nintersection nil nil :bad t :allow-other-keys nil))
722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738
  program-error)

(deftest nintersection.error.7
  (classify-error (nintersection (list 1 2 3) (list 4 5 6) :test #'identity))
  program-error)

(deftest nintersection.error.8
  (classify-error (nintersection (list 1 2 3) (list 4 5 6) :test-not #'identity))
  program-error)

(deftest nintersection.error.9
  (classify-error (nintersection (list 1 2 3) (list 4 5 6) :key #'cons))
  program-error)

(deftest nintersection.error.10
  (classify-error (nintersection (list 1 2 3) (list 4 5 6) :key #'car))
  type-error)