source: trunk/source/tests/ansi-tests/pathname-directory.lsp @ 8991

Last change on this file since 8991 was 8991, checked in by gz, 11 years ago

Check in the gcl ansi test suite (original, in preparation for making local changes)

File size: 2.5 KB
Line 
1;-*- Mode:     Lisp -*-
2;;;; Author:   Paul Dietz
3;;;; Created:  Sat Dec  6 14:24:39 2003
4;;;; Contains: Tests for PATHNAME-DIRECTORY
5
6(in-package :cl-test)
7
8(compile-and-load "pathnames-aux.lsp")
9
10(deftest pathname-directory.1
11  (loop for p in *pathnames*
12        for directory = (pathname-directory p)
13        unless (or (stringp directory)
14                   (member directory '(nil :wild :unspecific))
15                   (and (consp directory)
16                        (member (car directory) '(:absolute :relative))))
17        collect (list p directory))
18  nil)
19
20(deftest pathname-directory.2
21  (loop for p in *pathnames*
22        for directory = (pathname-directory p :case :local)
23        unless (or (stringp directory)
24                   (member directory '(nil :wild :unspecific))
25                   (and (consp directory)
26                        (member (car directory) '(:absolute :relative))))
27        collect (list p directory))
28  nil)
29
30(deftest pathname-directory.3
31  (loop for p in *pathnames*
32        for directory = (pathname-directory p :case :common)
33        unless (or (stringp directory)
34                   (member directory '(nil :wild :unspecific))
35                   (and (consp directory)
36                        (member (car directory) '(:absolute :relative))))
37        collect (list p directory))
38  nil)
39
40(deftest pathname-directory.4
41  (loop for p in *pathnames*
42        for directory = (pathname-directory p :allow-other-keys nil)
43        unless (or (stringp directory)
44                   (member directory '(nil :wild :unspecific))
45                   (and (consp directory)
46                        (member (car directory) '(:absolute :relative))))
47        collect (list p directory))
48  nil)
49
50(deftest pathname-directory.5
51  (loop for p in *pathnames*
52        for directory = (pathname-directory p :foo 'bar :allow-other-keys t)
53        unless (or (stringp directory)
54                   (member directory '(nil :wild :unspecific))
55                   (and (consp directory)
56                        (member (car directory) '(:absolute :relative))))
57        collect (list p directory))
58  nil)
59
60(deftest pathname-directory.6
61  (loop for p in *pathnames*
62        for directory = (pathname-directory p :allow-other-keys t
63                                            :allow-other-keys nil
64                                            'foo 'bar)
65        unless (or (stringp directory)
66                   (member directory '(nil :wild :unspecific))
67                   (and (consp directory)
68                        (member (car directory) '(:absolute :relative))))
69        collect (list p directory))
70  nil)
71
72;;; section 19.3.2.1
73(deftest pathname-directory.7
74  (loop for p in *logical-pathnames*
75        when (eq (pathname-directory p) :unspecific)
76        collect p)
77  nil)
78
79(deftest pathname-directory.8
80  (do-special-strings (s "" nil) (pathname-directory s))
81  nil)
82
83(deftest pathname-directory.error.1
84  (signals-error (pathname-directory) program-error)
85  t)
86
87(deftest pathname-directory.error.2
88  (check-type-error #'pathname-directory #'could-be-pathname-designator)
89  nil)
Note: See TracBrowser for help on using the repository browser.