source: trunk/source/tests/ansi-tests/probe-file.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.3 KB
Line 
1;-*- Mode:     Lisp -*-
2;;;; Author:   Paul Dietz
3;;;; Created:  Mon Jan  5 20:46:29 2004
4;;;; Contains: Tests of PROBE-FILE
5
6(in-package :cl-test)
7
8(deftest probe-file.1
9  (probe-file #p"nonexistent")
10  nil)
11
12(deftest probe-file.2
13  (let ((s (open #p"probe-file.lsp" :direction :input)))
14    (prog1
15        (equalpt (truename #p"probe-file.lsp")
16                 (probe-file s))
17      (close s)))
18  t)
19
20(deftest probe-file.3
21  (let ((s (open #p"probe-file.lsp" :direction :input)))
22    (close s)
23    (equalpt (truename #p"probe-file.lsp")
24             (probe-file s)))
25  t)
26
27(deftest probe-file.4
28  (equalpt (truename #p"probe-file.lsp")
29           (probe-file "CLTEST:probe-file.lsp"))
30  t)
31
32;;; Specialized string tests
33
34(deftest probe-file.5
35  (do-special-strings
36   (str "probe-file.lsp" nil)
37   (let ((s (open str :direction :input)))
38     (assert (equalpt (truename #p"probe-file.lsp") (probe-file s)))
39     (close s)))
40  nil)
41       
42;;; Error tests
43
44(deftest probe-file.error.1
45  (signals-error (probe-file) program-error)
46  t)
47
48(deftest probe-file.error.2
49  (signals-error (probe-file #p"probe-file.lsp" nil) program-error)
50  t)
51
52(deftest probe-file.error.3
53  (signals-error-always (probe-file (make-pathname :name :wild)) file-error)
54  t t)
55
56(deftest probe-file.error.4
57  (signals-error-always (probe-file "CLTEST:*.FOO") file-error)
58  t t)
Note: See TracBrowser for help on using the repository browser.