source: trunk/source/tests/ansi-tests/defconstant.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: 1.5 KB
Line 
1;-*- Mode:     Lisp -*-
2;;;; Author:   Paul Dietz
3;;;; Created:  Thu Oct 10 23:05:39 2002
4;;;; Contains: Tests of DEFCONSTANT
5
6(in-package :cl-test)
7
8(defconstant test-constant-1  17)
9
10(deftest defconstant.1
11  (symbol-value 'test-constant-1)
12  17)
13
14(deftest defconstant.2
15  (notnot-mv (constantp 'test-constant-1))
16  t)
17
18(deftest defconstant.3
19  (documentation 'test-constant-1 'variable)
20  nil)
21
22(defconstant test-constant-2 'a
23  "This is the documentation.")
24
25(deftest defconstant.4
26  (documentation 'test-constant-2 'variable)
27  "This is the documentation.")
28
29(deftest defconstant.5
30  (defconstant test-constant-3 0)
31  test-constant-3)
32
33;;; (deftest defconstant.error.1
34;;;   (signals-error (defconstant)  program-error)
35;;;   t)
36;;;
37;;; (deftest defconstant.error.2
38;;;   (signals-error (defconstant +ignorable-constant-name+) program-error)
39;;;   t)
40;;;
41;;; (deftest defconstant.error.3
42;;;   (signals-error (defconstant +ignorable-constant-name2+ nil
43;;;                 "This is a docstring"
44;;;                 "This is an unnecessary extra argument.")
45;;;                  program-error)
46;;;  t)
47
48(deftest defconstant.error.1
49  (signals-error (funcall (macro-function 'defconstant))
50                 program-error)
51  t)
52
53(deftest defconstant.error.2
54  (signals-error (funcall (macro-function 'defconstant)
55                           '(defconstant +nonexistent-constant+ 0))
56                 program-error)
57  t)
58
59(deftest defconstant.error.3
60  (signals-error (funcall (macro-function 'defconstant)
61                           '(defconstant +nonexistent-constant+ 0)
62                           nil nil)
63                 program-error)
64  t)
Note: See TracBrowser for help on using the repository browser.