Commit 1a89537e authored by pfdietz's avatar pfdietz

More pathname tests. Add IGNORE-ERRORS on the forms used in making the...

More pathname tests.  Add IGNORE-ERRORS on the forms used in making the *pathnames* variable, to prevent implementation bugs or limitations from preventing the tests from running altogether.
parent 59939db8
......@@ -6,4 +6,5 @@
(in-package :cl-test)
(load "pathnames.lsp")
(load "pathname.lsp")
(load "make-pathname.lsp")
;-*- Mode: Lisp -*-
;;;; Author: Paul Dietz
;;;; Created: Sat Nov 29 05:54:30 2003
;;;; Contains: Tests of MAKE-PATHNAME
(in-package :cl-test)
(defun make-pathname-test
(&rest args &key (defaults nil)
(host (if defaults (pathname-host defaults)
(pathname-host *default-pathname-defaults*)))
(device (if defaults (pathname-device defaults) nil))
(directory (if defaults (pathname-directory defaults) nil))
(name (if defaults (pathname-name defaults) nil))
(type (if defaults (pathname-type defaults) nil))
(version (if defaults (pathname-version defaults) nil))
case)
(declare (ignorable case))
(let* ((vals (multiple-value-list (apply #'make-pathname args)))
(pn (first vals)))
(and (= (length vals) 1)
(typep pn 'pathname)
(equalp (pathname-host pn) host)
(equalp (pathname-device pn) device)
;; (equalp (pathname-directory pn) directory)
(let ((pnd (pathname-directory pn)))
(if (eq directory :wild)
(member pnd '((:absolute :wild-inferiors)
(:absolute :wild))
:test #'equal)
(equalp pnd directory)))
(equalp (pathname-name pn) name)
(equalp (pathname-type pn) type)
(equalp (pathname-version pn) version)
t)))
(deftest make-pathname.1
(make-pathname-test)
t)
(deftest make-pathname.2
(make-pathname-test :name "foo")
t)
(deftest make-pathname.3
(make-pathname-test :name "foo" :type "txt")
t)
(deftest make-pathname.4
(make-pathname-test :type "lsp")
t)
(deftest make-pathname.5
(make-pathname-test :directory :wild)
t)
(deftest make-pathname.6
(make-pathname-test :name :wild)
t)
(deftest make-pathname.7
(make-pathname-test :type :wild)
t)
(deftest make-pathname.8
(make-pathname-test :version :wild)
t)
......@@ -17,4 +17,3 @@
(unless (equal p1 p2)
(list (list p1 s p2))))))
nil)
......@@ -317,19 +317,19 @@
))
(defparameter *pathnames*
(list
(make-pathname :name "foo")
(make-pathname :name "bar")
(make-pathname :name "foo" :type "txt")
(make-pathname :name "bar" :type "txt")
(make-pathname :name nil)
(make-pathname :name :wild)
(make-pathname :name nil :type "txt")
(make-pathname :name :wild :type "txt")
(make-pathname :directory :wild)
(make-pathname :type :wild)
(make-pathname :version :wild)
(make-pathname :version :newest)
(append
(ignore-errors (list (make-pathname :name "foo")))
(ignore-errors (list (make-pathname :name "bar")))
(ignore-errors (list (make-pathname :name "foo" :type "txt")))
(ignore-errors (list (make-pathname :name "bar" :type "txt")))
(ignore-errors (list (make-pathname :name nil)))
(ignore-errors (list (make-pathname :name :wild)))
(ignore-errors (list (make-pathname :name nil :type "txt")))
(ignore-errors (list (make-pathname :name :wild :type "txt")))
(ignore-errors (list (make-pathname :directory :wild)))
(ignore-errors (list (make-pathname :type :wild)))
(ignore-errors (list (make-pathname :version :wild)))
(ignore-errors (list (make-pathname :version :newest)))
))
(defparameter *streams*
......
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