~ubuntu-branches/ubuntu/quantal/gclcvs/quantal

« back to all changes in this revision

Viewing changes to ansi-tests/pathname-type.lsp

  • Committer: Bazaar Package Importer
  • Author(s): Camm Maguire
  • Date: 2004-06-24 15:13:46 UTC
  • Revision ID: james.westby@ubuntu.com-20040624151346-xh0xaaktyyp7aorc
Tags: 2.7.0-26
C_GC_OFFSET is 2 on m68k-linux

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
(deftest pathname-type.1
 
9
  (loop for p in *pathnames*
 
10
        for type = (pathname-type p)
 
11
        unless (or (stringp type)
 
12
                   (member type '(nil :wild :unspecific)))
 
13
        collect (list p type))
 
14
  nil)
 
15
 
 
16
(deftest pathname-type.2
 
17
  (loop for p in *pathnames*
 
18
        for type = (pathname-type p :case :local)
 
19
        unless (or (stringp type)
 
20
                   (member type '(nil :wild :unspecific)))
 
21
        collect (list p type))
 
22
  nil)
 
23
 
 
24
(deftest pathname-type.3
 
25
  (loop for p in *pathnames*
 
26
        for type = (pathname-type p :case :common)
 
27
        unless (or (stringp type)
 
28
                   (member type '(nil :wild :unspecific)))
 
29
        collect (list p type))
 
30
  nil)
 
31
 
 
32
(deftest pathname-type.4
 
33
  (loop for p in *pathnames*
 
34
        for type = (pathname-type p :allow-other-keys nil)
 
35
        unless (or (stringp type)
 
36
                   (member type '(nil :wild :unspecific)))
 
37
        collect (list p type))
 
38
  nil)
 
39
 
 
40
(deftest pathname-type.5
 
41
  (loop for p in *pathnames*
 
42
        for type = (pathname-type p :foo 'bar :allow-other-keys t)
 
43
        unless (or (stringp type)
 
44
                   (member type '(nil :wild :unspecific)))
 
45
        collect (list p type))
 
46
  nil)
 
47
 
 
48
(deftest pathname-type.6
 
49
  (loop for p in *pathnames*
 
50
        for type = (pathname-type p :allow-other-keys t :allow-other-keys nil :foo 'bar)
 
51
        unless (or (stringp type)
 
52
                   (member type '(nil :wild :unspecific)))
 
53
        collect (list p type))
 
54
  nil)
 
55
 
 
56
;;; section 19.3.2.1
 
57
(deftest pathname-type.7
 
58
  (loop for p in *logical-pathnames*
 
59
        when (eq (pathname-type p) :unspecific)
 
60
        collect p)
 
61
  nil)
 
62
 
 
63
(deftest pathname-type.error.1
 
64
  (signals-error (pathname-type) program-error)
 
65
  t)
 
66
 
 
67
(deftest pathname-type.error.2
 
68
  (loop for x in *mini-universe*
 
69
        unless (or (could-be-pathname-designator x)
 
70
                   (handler-case (progn (pathname-type x) nil)
 
71
                                 (type-error () t)
 
72
                                 (condition () nil)))
 
73
        collect x)
 
74
  nil)