anchor.diff:    (:import-from :alexandria))
   (in-package :lem-tests/buffer-list-test)
   
  -#|
  -- buffer-list
  -- any-modified-buffer-p
  -- get-buffer
  -- unique-buffer-name
  -- delete-buffer
  -- get-next-buffer
  -- get-previous-buffer
  -- unbruy-buffer
  -- bury-buffer
  -- get-file-buffer
  -|#
  -
   (defmacro with-buffer-list ((&optional buffer-list) &body body)
     `(let ((lem-base::*buffer-list* ,buffer-list))
        ,@body))
  +
  +(defun argument-type-is-buffer-test (function &key allow-string-p)
  +  (with-buffer-list ()
  +    (rove:testing "argument type"
  +      (rove:ok (rove:signals (funcall function nil) 'type-error))
  +      (rove:ok (rove:signals (funcall function 1) 'type-error))
  +      (rove:ok (rove:signals (funcall function #(#\a #\b)) 'type-error))
  +      (unless allow-string-p
  +        (rove:ok (rove:signals (funcall function "name") 'type-error))))))
   
   (rove:deftest buffer-list
     (with-buffer-list ()
  
positive.code:           (rove:ok (eq t (lem-base:any-modified-buffer-p))))))))
  
  (rove:deftest get-buffer
    (with-buffer-list ()
      (rove:testing "arugment type"
        (rove:ok (rove:signals (lem-base:get-buffer 1) 'type-error))
        (rove:ok (rove:signals (lem-base:get-buffer nil) 'type-error))
        (rove:ok (handler-case (lem-base:get-buffer "foo")
                   (error ()
                     nil)
                   (:no-error (buffer)
                     (null buffer))))
        (rove:ok (handler-case (lem-base:get-buffer (lem:make-buffer nil :temporary t))
                   (error ()
                     nil)
                   (:no-error (buffer)
                     (lem-base:bufferp buffer))))))
    (with-buffer-list ()
      (rove:ok (null (lem-base:get-buffer "a")))
      (let (buffer-a buffer-b buffer-c)
  
negative.code:       (rove:ok (equal "b" (lem-base:unique-buffer-name "b"))))))
  
  (rove:deftest delete-buffer
    (argument-type-is-buffer-test #'lem-base:delete-buffer)
    (with-buffer-list ()
      (let ((buffer-a (lem-base:make-buffer "a"))
            (buffer-b (lem-base:make-buffer "b"))
  