~ubuntu-branches/ubuntu/quantal/gclcvs/quantal

« back to all changes in this revision

Viewing changes to ansi-tests/defconstant.lsp

  • Committer: Bazaar Package Importer
  • Author(s): Camm Maguire
  • Date: 2004-06-24 15:13:46 UTC
  • Revision ID: james.westby@ubuntu.com-20040624151346-xh0xaaktyyp7aorc
Tags: 2.7.0-26
C_GC_OFFSET is 2 on m68k-linux

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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)