/[gcl]/gcl/ansi-tests/cons-test-05.lsp
ViewVC logotype

Diff of /gcl/ansi-tests/cons-test-05.lsp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.5 by pfdietz, Wed Nov 27 04:22:36 2002 UTC revision 1.6 by pfdietz, Mon Jan 13 14:11:49 2003 UTC
# Line 8  Line 8 
8    
9  (declaim (optimize (safety 3)))  (declaim (optimize (safety 3)))
10    
11    (defparameter *cons-accessors*
12      '(first second third fourth fifth sixth seventh eighth ninth tenth
13        car cdr caar cadr cdar cddr
14        caaar caadr cadar caddr cdaar cdadr cddar cdddr
15        caaaar caaadr caadar caaddr cadaar cadadr caddar cadddr
16        cdaaar cdaadr cdadar cdaddr cddaar cddadr cdddar cddddr))
17    
18  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
19  ;;; first, ..., tenth  ;;; first, ..., tenth
20    
# Line 117  Line 124 
124                 (nth ,(1- len) (car y))))                 (nth ,(1- len) (car y))))
125              a)))              a)))
126    
127    ;; set up program error tests
128    
129    (loop for name in *cons-accessors*
130          do (eval
131              `(deftest ,(intern (concatenate 'string (symbol-name name)
132                                                ".ERROR.NO-ARGS")
133                                   :cl-test)
134                 (classify-error (,name))
135                 program-error))
136          do (eval
137              `(deftest ,(intern (concatenate 'string (symbol-name name)
138                                                ".ERROR.EXCESS-ARGS")
139                                   :cl-test)
140                 (classify-error (,name nil nil))
141                 program-error)))    
142    
143  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
144  ;;; nth  ;;; nth
145    
146  (deftest nth-1  (deftest nth-1
147      (nth-1-body (loop for i from 1 to 2000 collect (* 4 i)))    (nth-1-body (loop for i from 1 to 2000 collect (* 4 i)))
148    0)    0)
149    
150  (deftest nth-2  (deftest nth-2
# Line 144  Line 167 
167       (eqlt z 2)       (eqlt z 2)
168       x))       x))
169    (a z c d))    (a z c d))
170    
171    (deftest nth.error.1
172      (classify-error (nth))
173      program-error)
174    
175    (deftest nth.error.2
176      (classify-error (nth 0))
177      program-error)
178    
179    (deftest nth.error.3
180      (classify-error (nth 1 '(a b c) nil))
181      program-error)
182    
183    (deftest nth.error.4
184      (classify-error (nth 0 '(a b c) nil))
185      program-error)

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26