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

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

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

revision 1.3 by pfdietz, Sat Nov 27 21:55:26 2004 UTC revision 1.4 by pfdietz, Wed Dec 8 14:42:26 2004 UTC
# Line 30  Line 30 
30          collect (format nil "~[a~;b~;c~;d~;e~;f~;g~;h~;i~]" i))          collect (format nil "~[a~;b~;c~;d~;e~;f~;g~;h~;i~]" i))
31    ("" "a" "b" "c" "d" "e" "f" "g" "h" "i" "" ""))    ("" "a" "b" "c" "d" "e" "f" "g" "h" "i" "" ""))
32    
33    (deftest formatter.cond.7
34      (let ((fn (formatter "~[a~;b~;c~;d~;e~;f~;g~;h~;i~]")))
35        (loop for i from -1 to 10
36              collect (formatter-call-to-string fn i)))
37      ("" "a" "b" "c" "d" "e" "f" "g" "h" "i" "" ""))
38    
39  (def-format-test format.cond.8  (def-format-test format.cond.8
40    "~0[a~;b~;c~;d~]" (3) "a" 1)    "~0[a~;b~;c~;d~]" (3) "a" 1)
41    
# Line 50  Line 56 
56          collect (format nil "~v[a~;b~;c~;d~;e~;f~;g~;h~;i~]" i nil))          collect (format nil "~v[a~;b~;c~;d~;e~;f~;g~;h~;i~]" i nil))
57    ("" "a" "b" "c" "d" "e" "f" "g" "h" "i" "" ""))    ("" "a" "b" "c" "d" "e" "f" "g" "h" "i" "" ""))
58    
59    (deftest formatter.cond.13
60      (let ((fn (formatter "~V[a~;b~;c~;d~;e~;f~;g~;h~;i~]")))
61        (loop for i from -1 to 10
62              collect (formatter-call-to-string fn i nil)))
63      ("" "a" "b" "c" "d" "e" "f" "g" "h" "i" "" ""))
64    
65  (deftest format.cond.14  (deftest format.cond.14
66    (loop for i from -1 to 10    (loop for i from -1 to 10
67          collect (format nil "~v[a~;b~;c~;d~;e~;f~;g~;h~;i~]" nil i))          collect (format nil "~v[a~;b~;c~;d~;e~;f~;g~;h~;i~]" nil i))
68    ("" "a" "b" "c" "d" "e" "f" "g" "h" "i" "" ""))    ("" "a" "b" "c" "d" "e" "f" "g" "h" "i" "" ""))
69    
70    (deftest formatter.cond.14
71      (let ((fn (formatter "~v[a~;b~;c~;d~;e~;f~;g~;h~;i~]")))
72        (loop for i from -1 to 10
73              collect (formatter-call-to-string fn nil i)))
74      ("" "a" "b" "c" "d" "e" "f" "g" "h" "i" "" ""))
75    
76  (def-format-test format.cond.15  (def-format-test format.cond.15
77    "~#[A~;B~]" nil "A")    "~#[A~;B~]" nil "A")
78    
# Line 70  Line 88 
88          collect (list i s))          collect (list i s))
89    nil)    nil)
90    
91    (deftest formatter.cond\:.1
92      (let ((fn (formatter "~[~:;a~]")))
93        (loop for i from -100 to 100
94              for s = (formatter-call-to-string fn i)
95              unless (or (zerop i) (string= s "a"))
96              collect (list i s)))
97      nil)
98    
99  (def-format-test format.cond\:.2  (def-format-test format.cond\:.2
100    "~[a~:;b~]" (0) "a")    "~[a~:;b~]" (0) "a")
101    
# Line 84  Line 110 
110          collect (format nil "~[a~;b~;c~;d~:;e~]" i))          collect (format nil "~[a~;b~;c~;d~:;e~]" i))
111    ("e" "a" "b" "c" "d" "e" "e" "e" "e" "e" "e" "e"))    ("e" "a" "b" "c" "d" "e" "e" "e" "e" "e" "e" "e"))
112    
113    (deftest formatter.cond\:.5
114      (let ((fn (formatter "~[a~;b~;c~;d~:;e~]")))
115        (loop for i from -1 to 10
116              collect (formatter-call-to-string fn i)))
117      ("e" "a" "b" "c" "d" "e" "e" "e" "e" "e" "e" "e"))
118    
119  (deftest format.cond\:.6  (deftest format.cond\:.6
120    (loop for i from -1 to 10    (loop for i from -1 to 10
121          collect (format nil "~v[a~;b~;c~;d~:;e~]" i nil))          collect (format nil "~v[a~;b~;c~;d~:;e~]" i nil))
122    ("e" "a" "b" "c" "d" "e" "e" "e" "e" "e" "e" "e"))    ("e" "a" "b" "c" "d" "e" "e" "e" "e" "e" "e" "e"))
123    
124    (deftest formatter.cond\:.6
125      (let ((fn (formatter "~v[a~;b~;c~;d~:;e~]")))
126        (loop for i from -1 to 10
127              collect (formatter-call-to-string fn i nil)))
128      ("e" "a" "b" "c" "d" "e" "e" "e" "e" "e" "e" "e"))
129    
130  (deftest format.cond\:.7  (deftest format.cond\:.7
131    (loop for i from -1 to 10    (loop for i from -1 to 10
132          collect (format nil "~v[a~;b~;c~;d~:;e~]" nil i))          collect (format nil "~v[a~;b~;c~;d~:;e~]" nil i))
133    ("e" "a" "b" "c" "d" "e" "e" "e" "e" "e" "e" "e"))    ("e" "a" "b" "c" "d" "e" "e" "e" "e" "e" "e" "e"))
134    
135    (deftest formatter.cond\:.7
136      (let ((fn (formatter "~v[a~;b~;c~;d~:;e~]")))
137        (loop for i from -1 to 10
138              collect (formatter-call-to-string fn nil i)))
139      ("e" "a" "b" "c" "d" "e" "e" "e" "e" "e" "e" "e"))
140    
141  (def-format-test format.cond\:.8  (def-format-test format.cond\:.8
142    "~#[A~:;B~]" nil "A")    "~#[A~:;B~]" nil "A")
143    
# Line 112  Line 156 
156          collect (list x s))          collect (list x s))
157    nil)    nil)
158    
159    (deftest formatter.\:cond.2
160      (let ((fn (formatter "~:[a~;b~]")))
161        (loop for x in *mini-universe*
162              for s = (formatter-call-to-string fn x)
163              when (and x (not (string= s "b")))
164              collect (list x s)))
165      nil)
166    
167  ;;; ~@[ ... ~]  ;;; ~@[ ... ~]
168    
169  (def-format-test format.@cond.1  (def-format-test format.@cond.1

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