;; deftests for figure 4.5 and 4.6 ;; do bst min and max - figure out how to show min and max (deftest test-bst-insert() (let ((nums nil)) (check (equal nil (dolist (x '(5 8 4 2 1 9 6 7 3)) ;; will return nil when complete (setf nums (bst-insert x nums #'<))))))) (deftest test-bst-find() (let ((nums (init-bst))) (check (equal nil (bst-find 12 nums #'<)) ; if nil, didn't find it (not (equal nil (bst-find 4 nums #'<)))))) ; if not nil, found it (deftest test-bst-remove() (let ((nums (init-bst))) (check (not (equal nil (bst-find 4 nums #'<))) ;;found if not nil (not (equal nil (setf nums (bst-remove 4 nums #'<)))) (equal nil (bst-find 4 nums #'<))))) ;; this time it will not be found