Commit 30eebe06 authored by pfdietz's avatar pfdietz

Added more pathname tests, particular tests involving logical pathnames.

parent eca223c1
......@@ -9,6 +9,7 @@
(load "pathnames.lsp")
(load "pathname.lsp")
(load "pathnamep.lsp")
(load "make-pathname.lsp")
(load "pathname-host.lsp")
(load "pathname-device.lsp")
......@@ -17,4 +18,5 @@
(load "pathname-type.lsp")
(load "pathname-version.lsp")
(load "logical-pathname.lsp")
(load "translate-logical-pathname.lsp")
;-*- Mode: Lisp -*-
;;;; Author: Paul Dietz
;;;; Created: Tue Dec 30 19:05:01 2003
;;;; Contains: Tests of LOGICAL-PATHNAME
(in-package :cl-test)
(deftest logical-pathname.1
(loop for x in *logical-pathnames*
always (eql x (logical-pathname x)))
t)
......@@ -53,6 +53,12 @@
collect (list p device))
nil)
;;; section 19.3.2.1
(deftest pathname-device.7
(loop for p in *logical-pathnames*
always (eq (pathname-device p) :unspecific))
t)
(deftest pathname-device.error.1
(classify-error (pathname-device))
program-error)
......
......@@ -67,6 +67,13 @@
collect (list p directory))
nil)
;;; section 19.3.2.1
(deftest pathname-directory.7
(loop for p in *logical-pathnames*
when (eq (pathname-directory p) :unspecific)
collect p)
nil)
(deftest pathname-directory.error.1
(classify-error (pathname-directory))
program-error)
......
......@@ -39,6 +39,13 @@
'foo t))) 1))
t)
;;; section 19.3.2.1
(deftest pathname-host.7
(loop for p in *logical-pathnames*
when (eq (pathname-host p) :unspecific)
collect p)
nil)
(deftest pathname-host.error.1
(classify-error (pathname-host))
program-error)
......
......@@ -53,6 +53,13 @@
collect (list p name))
nil)
;;; section 19.3.2.1
(deftest pathname-name.7
(loop for p in *logical-pathnames*
when (eq (pathname-name p) :unspecific)
collect p)
nil)
(deftest pathname-name.error.1
(classify-error (pathname-name))
program-error)
......
......@@ -53,6 +53,13 @@
collect (list p type))
nil)
;;; section 19.3.2.1
(deftest pathname-type.7
(loop for p in *logical-pathnames*
when (eq (pathname-type p) :unspecific)
collect p)
nil)
(deftest pathname-type.error.1
(classify-error (pathname-type))
program-error)
......
......@@ -12,6 +12,13 @@
collect (list p version))
nil)
;;; section 19.3.2.1
(deftest pathname-version.2
(loop for p in *logical-pathnames*
when (eq (pathname-version p) :unspecific)
collect p)
nil)
(deftest pathname-version.error.1
(classify-error (pathname-version))
program-error)
......
......@@ -10,7 +10,26 @@
always (eq x (pathname x)))
t)
;;; More here
(deftest pathname.2
(equalt #p"ansi-aux.lsp" (pathname "ansi-aux.lsp"))
t)
(deftest pathname.3
(let ((s (open "ansi-aux.lsp" :direction :input)))
(prog1 (equalt (truename (pathname s)) (truename #p"ansi-aux.lsp"))
(close s)))
t)
(deftest pathname.4
(let ((s (open "ansi-aux.lsp" :direction :input)))
(close s)
(equalt (truename (pathname s)) (truename #p"ansi-aux.lsp")))
t)
(deftest pathname.5
(loop for x in *logical-pathnames*
always (eq x (pathname x)))
t)
;;; Error tests
......
......@@ -17,6 +17,12 @@
always (eql (length (multiple-value-list (pathnamep x))) 1))
t)
(deftest pathnamep.3
(loop for x in *universe*
always (or (not (typep x 'logical-pathname))
(pathnamep x)))
t)
(deftest pathnamep.error.1
(classify-error (pathnamep))
program-error)
......
......@@ -338,7 +338,10 @@
(eval-when (load eval compile)
(setf (logical-pathname-translations "CLTESTROOT")
`(("**;*.*.*" ,(make-pathname :directory '(:absolute))))))
`(("**;*.*.*" ,(make-pathname :directory '(:absolute)))))
(setf (logical-pathname-translations "CLTEST")
`(("**;*.*.*" ,(make-pathname))))
)
(defparameter *logical-pathnames*
(append
......
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