source: trunk/source/tests/ansi-tests/defparameter.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.2 KB
Line 
1;-*- Mode:     Lisp -*-
2;;;; Author:   Paul Dietz
3;;;; Created:  Thu Oct 10 23:13:22 2002
4;;;; Contains: Tests of DEFPARAMETER
5
6(in-package :cl-test)
7
8(defparameter *defparameter-test-var-1* 100)
9
10(deftest defparameter.1
11  *defparameter-test-var-1*
12  100)
13
14(deftest defparameter.2
15  (documentation '*defparameter-test-var-1* 'variable)
16  nil)
17
18;;; Show that it's declared special.
19(deftest defparameter.3
20  (flet ((%f () *defparameter-test-var-1*))
21    (let ((*defparameter-test-var-1* 29))
22      (%f)))
23  29)
24
25(deftest defparameter.4
26  (values
27   (makunbound '*defparameter-test-var-2*)
28   (defparameter *defparameter-test-var-2* 200 "Whatever.")
29   (documentation '*defparameter-test-var-2* 'variable)
30   *defparameter-test-var-2*)
31  *defparameter-test-var-2*
32  *defparameter-test-var-2*
33  "Whatever."
34  200)
35
36(deftest defparameter.5
37  (values
38   (makunbound '*defparameter-test-var-2*)
39   (defparameter *defparameter-test-var-2* 200 "Whatever.")
40   (documentation '*defparameter-test-var-2* 'variable)
41   *defparameter-test-var-2*
42   (defparameter *defparameter-test-var-2* 300 "And ever.")
43   (documentation '*defparameter-test-var-2* 'variable)
44   *defparameter-test-var-2*
45   )
46  *defparameter-test-var-2*
47  *defparameter-test-var-2*
48  "Whatever."
49  200
50  *defparameter-test-var-2*
51  "And ever."
52  300)
53
54;;; (deftest defparameter.error.1
55;;;   (signals-error (defparameter)  program-error)
56;;;   t)
57;;;
58;;; (deftest defparameter.error.2
59;;;   (signals-error (defparameter *ignored-defparameter-name*)
60;;;                  program-error)
61;;;   t)
62;;;
63;;; (deftest defparameter.error.3
64;;;   (signals-error (defparameter *ignored-defparameter-name* nil
65;;;                 "documentation"
66;;;                 "illegal extra argument")
67;;;                  program-error)
68;;;   t)
69
70(deftest defparameter.error.1
71  (signals-error (funcall (macro-function 'defparameter))
72                 program-error)
73  t)
74
75(deftest defparameter.error.2
76  (signals-error (funcall (macro-function 'defparameter)
77                           '(defparameter *nonexistent-variable* nil))
78                 program-error)
79  t)
80
81(deftest defparameter.error.3
82  (signals-error (funcall (macro-function 'defparameter)
83                           '(defparameter *nonexistent-variable* nil)
84                           nil nil)
85                 program-error)
86  t)
Note: See TracBrowser for help on using the repository browser.