1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
|
;-*- Mode: Lisp -*-
;;;; Author: Paul Dietz
;;;; Created: Sat Nov 29 05:06:57 2003
;;;; Contains: Tests of the function PATHNAME
(in-package :cl-test)
(deftest pathname.1
(loop for x in *pathnames*
always (eq x (pathname x)))
t)
(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)
(deftest pathname.6
(equalt #p"ansi-aux.lsp"
(pathname (make-array 12 :initial-contents "ansi-aux.lsp"
:element-type 'base-char)))
t)
(deftest pathname.7
(equalt #p"ansi-aux.lsp"
(pathname (make-array 15 :initial-contents "ansi-aux.lspXXX"
:element-type 'base-char
:fill-pointer 12)))
t)
(deftest pathname.8
(equalt #p"ansi-aux.lsp"
(pathname (make-array 12 :initial-contents "ansi-aux.lsp"
:element-type 'base-char
:adjustable t)))
t)
(deftest pathname.9
(equalt #p"ansi-aux.lsp"
(pathname (make-array 15 :initial-contents "ansi-aux.lspXXX"
:element-type 'character
:fill-pointer 12)))
t)
(deftest pathname.10
(equalt #p"ansi-aux.lsp"
(pathname (make-array 12 :initial-contents "ansi-aux.lsp"
:element-type 'character
:adjustable t)))
t)
(deftest pathname.11
(loop for etype in '(standard-char base-char character)
collect
(equalt #p"ansi-aux.lsp"
(pathname
(let* ((s (make-array 15 :initial-contents "XXansi-aux.lspX"
:element-type etype)))
(make-array 12 :element-type etype
:displaced-to s
:displaced-index-offset 2)))))
(t t t))
;;; Error tests
(deftest pathname.error.1
(signals-error (pathname) program-error)
t)
(deftest pathname.error.2
(signals-error (pathname (first *pathnames*) nil) program-error)
t)
|