source: trunk/source/tests/ansi-tests/modules.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:  Sat Apr 30 19:51:06 2005
4;;;; Contains: Tests of *MODULES*, PROVIDE, and REQUIRE
5
6(in-package :cl-test)
7
8(deftest modules.1
9  (notnot (every #'stringp *modules*))
10  t)
11
12(deftest modules.2
13  (let ((*modules* *modules*))
14    (provide "FOO")
15    (notnot (member "FOO" *modules* :test #'string=)))
16  t)
17
18(deftest modules.3
19  (let ((*modules* *modules*))
20    (provide "FOO")
21    (provide "FOO")
22    (count "FOO" *modules* :test #'string=))
23  1)
24
25(deftest modules.4
26  (let ((*modules* *modules*))
27    (provide "FOO")
28    (require "FOO")
29    (values)))
30
31(deftest modules.5
32  (let ((*modules* *modules*))
33    (provide :|FOO|)
34    (notnot (member "FOO" *modules* :test #'string=)))
35  t)
36
37(deftest modules.6
38  (let ((*modules* *modules*))
39    (provide "FOO")
40    (require :|FOO|)
41    (values)))
42
43(deftest modules.7
44  (let ((*modules* *modules*)
45        (fn 'modules7-fun))
46    (when (fboundp fn) (fmakunbound fn))
47    (require "MODULES-7" #p"modules7.lsp")
48    (funcall fn))
49  :good)
50
51(deftest modules.8
52  (let ((*modules* *modules*)
53        (fns '(modules8a-fun modules8b-fun)))
54    (dolist (fn fns)
55      (when (fboundp fn) (fmakunbound fn)))
56    (require "MODULES-8" '(#p"modules8a.lsp" #p"modules8b.lsp"))
57    (mapcar #'funcall fns))
58  (:good :also-good))
59
60(deftest modules.9
61  (signals-error (require "AB7djaCgaaL") error)
62  t)
63
64(deftest modules.10
65  (do-special-strings
66   (s "FOO")
67   (let ((*modules* *modules*))
68     (provide s)
69     (assert (member "FOO" *modules* :test #'string=))))
70  nil)
71
72(deftest modules.11
73  (do-special-strings
74   (s "FOO")
75   (let ((*modules* *modules*))
76     (provide "FOO")
77     (require s)
78     (values)))
79  nil)
80
81(deftest modules.12
82  (unless (member "Z" *modules* :test #'string=)
83    (let ((*modules* *modules*))
84      (provide #\Z)
85      (not (member "Z" *modules* :test #'string=))))
86  nil)
87
88(deftest modules.13
89  (unless (member "Z" *modules* :test #'string=)
90    (let ((*modules* *modules*))
91      (provide "Z")
92      (require #\Z)
93      nil))
94  nil)
Note: See TracBrowser for help on using the repository browser.