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
|
;-*- Mode: Lisp -*-
;;;; Author: Paul Dietz
;;;; Created: Sat Dec 6 14:45:16 2003
;;;; Contains: Tests for PATHNAME-TYPE
(in-package :cl-test)
(compile-and-load "pathnames-aux.lsp")
(deftest pathname-type.1
(loop for p in *pathnames*
for type = (pathname-type p)
unless (or (stringp type)
(member type '(nil :wild :unspecific)))
collect (list p type))
nil)
(deftest pathname-type.2
(loop for p in *pathnames*
for type = (pathname-type p :case :local)
unless (or (stringp type)
(member type '(nil :wild :unspecific)))
collect (list p type))
nil)
(deftest pathname-type.3
(loop for p in *pathnames*
for type = (pathname-type p :case :common)
unless (or (stringp type)
(member type '(nil :wild :unspecific)))
collect (list p type))
nil)
(deftest pathname-type.4
(loop for p in *pathnames*
for type = (pathname-type p :allow-other-keys nil)
unless (or (stringp type)
(member type '(nil :wild :unspecific)))
collect (list p type))
nil)
(deftest pathname-type.5
(loop for p in *pathnames*
for type = (pathname-type p :foo 'bar :allow-other-keys t)
unless (or (stringp type)
(member type '(nil :wild :unspecific)))
collect (list p type))
nil)
(deftest pathname-type.6
(loop for p in *pathnames*
for type = (pathname-type p :allow-other-keys t :allow-other-keys nil :foo 'bar)
unless (or (stringp type)
(member type '(nil :wild :unspecific)))
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.8
(do-special-strings (s "" nil) (pathname-type s))
nil)
(deftest pathname-type.error.1
(signals-error (pathname-type) program-error)
t)
(deftest pathname-type.error.2
(check-type-error #'pathname-type #'could-be-pathname-designator)
nil)
|