source: trunk/source/tests/ansi-tests/file-author.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.0 KB
Line 
1;-*- Mode:     Lisp -*-
2;;;; Author:   Paul Dietz
3;;;; Created:  Tue Jan  6 05:41:06 2004
4;;;; Contains: Tests of FILE-AUTHOR
5
6(in-package :cl-test)
7
8(deftest file-author.1
9  (loop for pn in
10        (directory (make-pathname :name :wild :type :wild
11                                  :defaults *default-pathname-defaults*))
12        for author = (file-author pn)
13        unless (or (null author) (stringp author))
14        collect (list pn author))
15  nil)
16
17(deftest file-author.2
18  (let ((author (file-author "file-author.lsp")))
19    (if (or (null author) (stringp author))
20        nil
21      author))
22  nil)
23
24(deftest file-author.3
25  (let ((author (file-author #p"file-author.lsp")))
26    (if (or (null author) (stringp author))
27        nil
28      author))
29  nil)
30
31(deftest file-author.4
32  (let ((author (file-author (truename "file-author.lsp"))))
33    (if (or (null author) (stringp author))
34        nil
35      author))
36  nil)
37
38(deftest file-author.5
39  (let ((author (with-open-file (s "file-author.lsp" :direction :input)
40                                (file-author s))))
41    (if (or (null author) (stringp author))
42        nil
43      author))
44  nil)
45
46(deftest file-author.6
47  (let ((author (let ((s (open "file-author.lsp" :direction :input)))
48                  (close s)
49                  (file-author s))))
50    (if (or (null author) (stringp author))
51        nil
52      author))
53  nil)
54
55;;; Specialized string tests
56
57(deftest file-author.7
58  (do-special-strings
59   (s "file-author.lsp" nil)
60   (assert (equal (file-author s) (file-author "file-author.lsp"))))
61  nil)
62
63;;; FIXME
64;;; Add LPN test
65
66;;; Error tests
67
68(deftest file-author.error.1
69  (signals-error (file-author) program-error)
70  t)
71
72(deftest file-author.error.2
73  (signals-error (file-author "file-author.lsp" nil) program-error)
74  t)
75
76(deftest file-author.error.3
77  (signals-error-always
78   (file-author (make-pathname :name :wild :type "lsp"
79                               :defaults *default-pathname-defaults*))
80   file-error)
81  t t)
82
83(deftest file-author.error.4
84  (signals-error-always
85   (file-author (make-pathname :name "file-author" :type :wild
86                               :defaults *default-pathname-defaults*))
87   file-error)
88  t t)
Note: See TracBrowser for help on using the repository browser.