/[gcl]/gcl/ansi-tests/format-d.lsp
ViewVC logotype

Diff of /gcl/ansi-tests/format-d.lsp

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

revision 1.3 by pfdietz, Mon Dec 6 14:04:21 2004 UTC revision 1.4 by pfdietz, Mon Jul 4 13:16:49 2005 UTC
# Line 104  Line 104 
104    
105  (deftest format.d.4  (deftest format.d.4
106    (with-standard-io-syntax    (with-standard-io-syntax
107     (loop for x = (ash 1 (+ 2 (random 80)))     (loop with limit = 10
108             with count = 0
109             for x = (ash 1 (+ 2 (random 80)))
110           for mincol = (random 30)           for mincol = (random 30)
111           for i = (- (random (+ x x)) x)           for i = (- (random (+ x x)) x)
112           for s1 = (format nil "~@D" i)           for s1 = (format nil "~@D" i)
113           for s2 = (format nil (format nil "~~~d@d" mincol) i)           for format-string = (format nil "~~~d@d" mincol)
114             for s2 = (format nil format-string i)
115           for pos = (search s1 s2)           for pos = (search s1 s2)
116           repeat 1000           repeat 1000
117           when (or (null pos)           when (or (null pos)
# Line 117  Line 120 
120                         (or (/= (length s2) mincol)                         (or (/= (length s2) mincol)
121                             (not (eql (position #\Space s2 :test-not #'eql)                             (not (eql (position #\Space s2 :test-not #'eql)
122                                       (- (length s2) (length s1)))))))                                       (- (length s2) (length s1)))))))
123           collect (list i mincol s1 s2 pos)))           collect (if (> (incf count) limit)
124                         "Count limit exceeded"
125                         (list i mincol s1 format-string s2 pos))
126             while (<= count limit)))
127    nil)    nil)
128    
129  (deftest formatter.d.4  (deftest formatter.d.4
130    (with-standard-io-syntax    (with-standard-io-syntax
131     (loop for x = (ash 1 (+ 2 (random 80)))     (loop with limit = 10
132             with count = 0
133             for x = (ash 1 (+ 2 (random 80)))
134           for mincol = (random 30)           for mincol = (random 30)
135           for i = (- (random (+ x x)) x)           for i = (- (random (+ x x)) x)
136           for s1 = (format nil "~@D" i)           for s1 = (format nil "~@D" i)
# Line 137  Line 145 
145                         (or (/= (length s2) mincol)                         (or (/= (length s2) mincol)
146                             (not (eql (position #\Space s2 :test-not #'eql)                             (not (eql (position #\Space s2 :test-not #'eql)
147                                       (- (length s2) (length s1)))))))                                       (- (length s2) (length s1)))))))
148           collect (list i mincol s1 s2 pos)))           collect (if (> (incf count) limit)
149                         "Count limit exceeded"
150                       (list i mincol s1 s2 pos))
151             while (<= count limit)))
152    nil)    nil)
153    
154  (deftest format.d.5  (deftest format.d.5
# Line 202  Line 213 
213  (deftest format.d.7  (deftest format.d.7
214    (let ((fn (formatter "~v,v@D")))    (let ((fn (formatter "~v,v@D")))
215      (with-standard-io-syntax      (with-standard-io-syntax
216       (loop for x = (ash 1 (+ 2 (random 80)))       (loop with limit = 10
217               with count = 0
218               for x = (ash 1 (+ 2 (random 80)))
219             for mincol = (random 30)             for mincol = (random 30)
220             for padchar = (random-from-seq +standard-chars+)             for padchar = (random-from-seq +standard-chars+)
221             for i = (- (random (+ x x)) x)             for i = (- (random (+ x x)) x)
# Line 218  Line 231 
231                           (or (/= (length s2) mincol)                           (or (/= (length s2) mincol)
232                               (find padchar s2 :end (- (length s2) (length s1))                               (find padchar s2 :end (- (length s2) (length s1))
233                                     :test-not #'eql))))                                     :test-not #'eql))))
234             collect (list i mincol s1 s2 pos))))             collect (if (> (incf count) limit)
235                           "Count limit exceeded"
236                         (list i mincol s1 s2 s3 pos))
237               while (<= count limit))))
238    nil)    nil)
239    
240  ;;; Comma tests  ;;; Comma tests

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

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