Skip to content
test-utilities.script 2.64 KiB
Newer Older

(assert
 (every #'directory-pathname-p
  (list
   (make-pathname :name nil :type "" :directory '(:absolute "tmp"))
   (make-pathname :name "" :directory '(:absolute "tmp"))
   (make-pathname :type "" :directory '(:absolute "tmp"))
;; CLHS 19.2.2.2.3 says we can't portably specify :unspecific here,
;; and some implementations will enforce it.
;;   (make-pathname :type :unspecific :directory '(:absolute "tmp"))
;;   (make-pathname :name :unspecific :directory '(:absolute "tmp"))
;;   (make-pathname :name :unspecific :directory '(:absolute "tmp"))
   )))
(assert
 (every (complement #'directory-pathname-p)
  (list
   (make-pathname :name "foo" :type nil :directory '(:absolute "tmp"))
   (make-pathname :name nil :type "bar" :directory '(:absolute "tmp")))))
;; These are funky and non portable. Omit from tests.
;; (make-pathname :name "." :type nil :directory '(:absolute "tmp"))
;; (make-pathname :name "." :type "" :directory '(:absolute "tmp"))
(assert (equal (multiple-value-list (component-name-to-pathname-components "" :force-directory t))
(assert (equal (multiple-value-list (component-name-to-pathname-components ""  :force-directory nil))
(assert (equal (multiple-value-list (component-name-to-pathname-components "/" :force-directory t))
(assert (equal (multiple-value-list (component-name-to-pathname-components "/" :force-directory nil))
(assert (equal (multiple-value-list (component-name-to-pathname-components "/aa/ba" :force-directory t))
(assert (equal (multiple-value-list (component-name-to-pathname-components "/aa/ba" :force-directory nil))
 (version-satisfies (asdf-version) (asdf-version)))
 (version-satisfies (asdf-version) "2.000"))
 (not (version-satisfies (asdf-version) "666")))
(assert
  (equal (asdf::split-absolute-pathnames "/foo:/bar" "baz") '("/foo" "/bar")))
(assert (equal (mapcar 'asdf::location-function-p
                       '((:function f)
                         (:function (lambda (path absolute-source)
                                      (declare (ignore absolute-source))
                                      path))
                         (function previous-isnt-keyword)
                         (:function f too many arguments)
                         (:function (:lambda isnt lambda))
                         (:function (lambda (too many args) blah))))
               '(t t nil nil nil nil)))