Commit 358e0366 authored by pfdietz's avatar pfdietz

Added tests for a tricky case involving searching for NIL in association lists.

parent 7d163d59
......@@ -150,6 +150,26 @@
(assoc 10 '((1 a) (5 b) (8 c) (11 d) (12 e)) :test-not #'>=)
(11 d))
;;; Special case: the nil key does not match the nil pair
(deftest assoc.28
(assoc nil '((a . b) nil (c . d) (nil . e) (nil . f) nil (g . h)))
(nil . e))
(deftest assoc.29
(assoc nil '((a . b) nil (c . d) (nil . e) (nil . f) nil (g . h))
:test #'eq)
(nil . e))
(deftest assoc.30
(let () (assoc nil '((a . b) nil (c . d) (nil . e) (nil . f) nil (g . h))))
(nil . e))
(deftest assoc.31
(let () (assoc nil '((a . b) nil (c . d) (nil . e) (nil . f) nil (g . h))
:test #'eq))
(nil . e))
;;; :test & :test-not together are harmless
(defharmless assoc.test-and-test-not.1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment