Skip to content
Snippets Groups Projects
test-utilities.script 1.97 KiB
Newer Older
;;; -*- Lisp -*-
(load "script-support")
(in-package :asdf)
(cl-user::quit-on-error

(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 "" t))
               '(:relative nil nil)))
(assert (equal (multiple-value-list (component-name-to-pathname-components "" nil))
               '(:relative nil nil)))
(assert (equal (multiple-value-list (component-name-to-pathname-components "/" t))
               '(:absolute nil nil)))
(assert (equal (multiple-value-list (component-name-to-pathname-components "/" nil))
               '(:absolute nil nil)))
(assert (equal (multiple-value-list (component-name-to-pathname-components "/aa/ba" t))
               '(:absolute ("aa" "ba") nil)))
(assert (equal (multiple-value-list (component-name-to-pathname-components "/aa/ba" nil))
               '(:absolute ("aa") "ba")))
(assert
 (asdf::version-satisfies (asdf:asdf-version) (asdf:asdf-version)))
(assert
 (asdf::version-satisfies (asdf:asdf-version) "2.000"))
(assert
 (not (asdf::version-satisfies (asdf:asdf-version) "666")))