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