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