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

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

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

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