/[gcl]/gcl/ansi-tests/nsubstitute-if-not.lsp
ViewVC logotype

Diff of /gcl/ansi-tests/nsubstitute-if-not.lsp

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

revision 1.8 by pfdietz, Sat Feb 22 01:15:59 2003 UTC revision 1.9 by pfdietz, Thu Mar 20 00:04:27 2003 UTC
# Line 10  Line 10 
10    nil)    nil)
11    
12  (deftest nsubstitute-if-not-list.2  (deftest nsubstitute-if-not-list.2
13    (let ((x (copy-seq '(a b a c)))) (nsubstitute-if-not 'b (is-not-eq-p 'a) x) x)    (let ((x (copy-seq '(a b a c)))) (nsubstitute-if-not 'b (is-not-eql-p 'a) x) x)
14    (b b b c))    (b b b c))
15    
16  (deftest nsubstitute-if-not-list.3  (deftest nsubstitute-if-not-list.3
17    (let ((x (copy-seq '(a b a c)))) (nsubstitute-if-not 'b (is-not-eq-p 'a) x :count nil))    (let ((x (copy-seq '(a b a c)))) (nsubstitute-if-not 'b (is-not-eql-p 'a) x :count nil))
18    (b b b c))    (b b b c))
19    
20  (deftest nsubstitute-if-not-list.4  (deftest nsubstitute-if-not-list.4
21    (let ((x (copy-seq '(a b a c)))) (nsubstitute-if-not 'b (is-not-eq-p 'a) x :count 2))    (let ((x (copy-seq '(a b a c)))) (nsubstitute-if-not 'b (is-not-eql-p 'a) x :count 2))
22    (b b b c))    (b b b c))
23    
24  (deftest nsubstitute-if-not-list.5  (deftest nsubstitute-if-not-list.5
25    (let ((x (copy-seq '(a b a c)))) (nsubstitute-if-not 'b (is-not-eq-p 'a) x :count 1))    (let ((x (copy-seq '(a b a c)))) (nsubstitute-if-not 'b (is-not-eql-p 'a) x :count 1))
26    (b b a c))    (b b a c))
27    
28  (deftest nsubstitute-if-not-list.6  (deftest nsubstitute-if-not-list.6
29    (let ((x (copy-seq '(a b a c)))) (nsubstitute-if-not 'b (is-not-eq-p 'a) x :count 0))    (let ((x (copy-seq '(a b a c)))) (nsubstitute-if-not 'b (is-not-eql-p 'a) x :count 0))
30    (a b a c))    (a b a c))
31    
32  (deftest nsubstitute-if-not-list.7  (deftest nsubstitute-if-not-list.7
33    (let ((x (copy-seq '(a b a c)))) (nsubstitute-if-not 'b (is-not-eq-p 'a) x :count -1))    (let ((x (copy-seq '(a b a c)))) (nsubstitute-if-not 'b (is-not-eql-p 'a) x :count -1))
34    (a b a c))    (a b a c))
35    
36  (deftest nsubstitute-if-not-list.8  (deftest nsubstitute-if-not-list.8
37    (nsubstitute-if-not 'b (is-not-eq-p 'a) nil :from-end t)    (nsubstitute-if-not 'b (is-not-eql-p 'a) nil :from-end t)
38    nil)    nil)
39    
40  (deftest nsubstitute-if-not-list.9  (deftest nsubstitute-if-not-list.9
41    (let ((x (copy-seq '(a b a c)))) (nsubstitute-if-not 'b (is-not-eq-p 'a) x :from-end t))    (let ((x (copy-seq '(a b a c)))) (nsubstitute-if-not 'b (is-not-eql-p 'a) x :from-end t))
42    (b b b c))    (b b b c))
43    
44  (deftest nsubstitute-if-not-list.10  (deftest nsubstitute-if-not-list.10
45    (let ((x (copy-seq '(a b a c)))) (nsubstitute-if-not 'b (is-not-eq-p 'a) x :from-end t :count nil))    (let ((x (copy-seq '(a b a c)))) (nsubstitute-if-not 'b (is-not-eql-p 'a) x :from-end t :count nil))
46    (b b b c))    (b b b c))
47    
48  (deftest nsubstitute-if-not-list.11  (deftest nsubstitute-if-not-list.11
49    (let ((x (copy-seq '(a b a c)))) (nsubstitute-if-not 'b (is-not-eq-p 'a) x :count 2 :from-end t))    (let ((x (copy-seq '(a b a c)))) (nsubstitute-if-not 'b (is-not-eql-p 'a) x :count 2 :from-end t))
50    (b b b c))    (b b b c))
51    
52  (deftest nsubstitute-if-not-list.12  (deftest nsubstitute-if-not-list.12
53    (let ((x (copy-seq '(a b a c)))) (nsubstitute-if-not 'b (is-not-eq-p 'a) x :count 1 :from-end t))    (let ((x (copy-seq '(a b a c)))) (nsubstitute-if-not 'b (is-not-eql-p 'a) x :count 1 :from-end t))
54    (a b b c))    (a b b c))
55    
56  (deftest nsubstitute-if-not-list.13  (deftest nsubstitute-if-not-list.13
57    (let ((x (copy-seq '(a b a c)))) (nsubstitute-if-not 'b (is-not-eq-p 'a) x :count 0 :from-end t))    (let ((x (copy-seq '(a b a c)))) (nsubstitute-if-not 'b (is-not-eql-p 'a) x :count 0 :from-end t))
58    (a b a c))    (a b a c))
59    
60  (deftest nsubstitute-if-not-list.14  (deftest nsubstitute-if-not-list.14
61    (let ((x (copy-seq '(a b a c)))) (nsubstitute-if-not 'b (is-not-eq-p 'a) x :count -1 :from-end t))    (let ((x (copy-seq '(a b a c)))) (nsubstitute-if-not 'b (is-not-eql-p 'a) x :count -1 :from-end t))
62    (a b a c))    (a b a c))
63    
64  (deftest nsubstitute-if-not-list.15  (deftest nsubstitute-if-not-list.15
# Line 66  Line 66 
66          (loop for j from i to 10 always          (loop for j from i to 10 always
67                (let* ((orig '(a a a a a a a a a a))                (let* ((orig '(a a a a a a a a a a))
68                       (x (copy-seq orig))                       (x (copy-seq orig))
69                       (y (nsubstitute-if-not 'x (is-not-eq-p 'a) x :start i :end j)))                       (y (nsubstitute-if-not 'x (is-not-eql-p 'a) x :start i :end j)))
70                  (equal y (nconc (make-list i :initial-element 'a)                  (equal y (nconc (make-list i :initial-element 'a)
71                                  (make-list (- j i) :initial-element 'x)                                  (make-list (- j i) :initial-element 'x)
72                                  (make-list (- 10 j) :initial-element 'a))))))                                  (make-list (- 10 j) :initial-element 'a))))))
# Line 77  Line 77 
77          (loop for j from i to 10 always          (loop for j from i to 10 always
78                (let* ((orig '(a a a a a a a a a a))                (let* ((orig '(a a a a a a a a a a))
79                       (x (copy-seq orig))                       (x (copy-seq orig))
80                       (y (nsubstitute-if-not 'x (is-not-eq-p 'a) x :start i :end j :from-end t)))                       (y (nsubstitute-if-not 'x (is-not-eql-p 'a) x :start i :end j :from-end t)))
81                  (equal y (nconc (make-list i :initial-element 'a)                  (equal y (nconc (make-list i :initial-element 'a)
82                                  (make-list (- j i) :initial-element 'x)                                  (make-list (- j i) :initial-element 'x)
83                                  (make-list (- 10 j) :initial-element 'a))))))                                  (make-list (- 10 j) :initial-element 'a))))))
# Line 89  Line 89 
89                (loop for c from 0 to (- j i) always                (loop for c from 0 to (- j i) always
90                      (let* ((orig '(a a a a a a a a a a))                      (let* ((orig '(a a a a a a a a a a))
91                             (x (copy-seq orig))                             (x (copy-seq orig))
92                             (y (nsubstitute-if-not 'x (is-not-eq-p 'a) x :start i :end j :count c)))                             (y (nsubstitute-if-not 'x (is-not-eql-p 'a) x :start i :end j :count c)))
93                        (equal y (nconc (make-list i :initial-element 'a)                        (equal y (nconc (make-list i :initial-element 'a)
94                                        (make-list c :initial-element 'x)                                        (make-list c :initial-element 'x)
95                                        (make-list (- 10 (+ i c)) :initial-element 'a)))))))                                        (make-list (- 10 (+ i c)) :initial-element 'a)))))))
# Line 101  Line 101 
101                (loop for c from 0 to (- j i) always                (loop for c from 0 to (- j i) always
102                      (let* ((orig '(a a a a a a a a a a))                      (let* ((orig '(a a a a a a a a a a))
103                             (x (copy-seq orig))                             (x (copy-seq orig))
104                             (y (nsubstitute-if-not 'x (is-not-eq-p 'a) x :start i :end j :count c :from-end t)))                             (y (nsubstitute-if-not 'x (is-not-eql-p 'a) x :start i :end j :count c :from-end t)))
105                        (equal y (nconc (make-list (- j c) :initial-element 'a)                        (equal y (nconc (make-list (- j c) :initial-element 'a)
106                                        (make-list c :initial-element 'x)                                        (make-list c :initial-element 'x)
107                                        (make-list (- 10 j) :initial-element 'a)))))))                                        (make-list (- 10 j) :initial-element 'a)))))))
# Line 110  Line 110 
110  ;;; Tests on vectors  ;;; Tests on vectors
111    
112  (deftest nsubstitute-if-not-vector.1  (deftest nsubstitute-if-not-vector.1
113    (let ((x #())) (nsubstitute-if-not 'b (is-not-eq-p 'a) x))    (let ((x #())) (nsubstitute-if-not 'b (is-not-eql-p 'a) x))
114    #())    #())
115    
116  (deftest nsubstitute-if-not-vector.2  (deftest nsubstitute-if-not-vector.2
117    (let ((x (copy-seq #(a b a c)))) (nsubstitute-if-not 'b (is-not-eq-p 'a) x))    (let ((x (copy-seq #(a b a c)))) (nsubstitute-if-not 'b (is-not-eql-p 'a) x))
118    #(b b b c))    #(b b b c))
119    
120  (deftest nsubstitute-if-not-vector.3  (deftest nsubstitute-if-not-vector.3
121    (let ((x (copy-seq #(a b a c)))) (nsubstitute-if-not 'b (is-not-eq-p 'a) x :count nil) x)    (let ((x (copy-seq #(a b a c)))) (nsubstitute-if-not 'b (is-not-eql-p 'a) x :count nil) x)
122    #(b b b c))    #(b b b c))
123    
124  (deftest nsubstitute-if-not-vector.4  (deftest nsubstitute-if-not-vector.4
125    (let ((x (copy-seq #(a b a c)))) (nsubstitute-if-not 'b (is-not-eq-p 'a) x :count 2))    (let ((x (copy-seq #(a b a c)))) (nsubstitute-if-not 'b (is-not-eql-p 'a) x :count 2))
126    #(b b b c))    #(b b b c))
127    
128  (deftest nsubstitute-if-not-vector.5  (deftest nsubstitute-if-not-vector.5
129    (let ((x (copy-seq #(a b a c)))) (nsubstitute-if-not 'b (is-not-eq-p 'a) x :count 1))    (let ((x (copy-seq #(a b a c)))) (nsubstitute-if-not 'b (is-not-eql-p 'a) x :count 1))
130    #(b b a c))    #(b b a c))
131    
132  (deftest nsubstitute-if-not-vector.6  (deftest nsubstitute-if-not-vector.6
133    (let ((x (copy-seq #(a b a c)))) (nsubstitute-if-not 'b (is-not-eq-p 'a) x :count 0))    (let ((x (copy-seq #(a b a c)))) (nsubstitute-if-not 'b (is-not-eql-p 'a) x :count 0))
134    #(a b a c))    #(a b a c))
135    
136  (deftest nsubstitute-if-not-vector.7  (deftest nsubstitute-if-not-vector.7
137    (let ((x (copy-seq #(a b a c)))) (nsubstitute-if-not 'b (is-not-eq-p 'a) x :count -1))    (let ((x (copy-seq #(a b a c)))) (nsubstitute-if-not 'b (is-not-eql-p 'a) x :count -1))
138    #(a b a c))    #(a b a c))
139    
140  (deftest nsubstitute-if-not-vector.8  (deftest nsubstitute-if-not-vector.8
141    (let ((x #())) (nsubstitute-if-not 'b (is-not-eq-p 'a) x :from-end t))    (let ((x #())) (nsubstitute-if-not 'b (is-not-eql-p 'a) x :from-end t))
142    #())    #())
143    
144  (deftest nsubstitute-if-not-vector.9  (deftest nsubstitute-if-not-vector.9
145    (let ((x (copy-seq #(a b a c)))) (nsubstitute-if-not 'b (is-not-eq-p 'a) x :from-end t))    (let ((x (copy-seq #(a b a c)))) (nsubstitute-if-not 'b (is-not-eql-p 'a) x :from-end t))
146    #(b b b c))    #(b b b c))
147    
148  (deftest nsubstitute-if-not-vector.10  (deftest nsubstitute-if-not-vector.10
149    (let ((x (copy-seq #(a b a c)))) (nsubstitute-if-not 'b (is-not-eq-p 'a) x :from-end t :count nil))    (let ((x (copy-seq #(a b a c)))) (nsubstitute-if-not 'b (is-not-eql-p 'a) x :from-end t :count nil))
150    #(b b b c))    #(b b b c))
151    
152  (deftest nsubstitute-if-not-vector.11  (deftest nsubstitute-if-not-vector.11
153    (let ((x (copy-seq #(a b a c)))) (nsubstitute-if-not 'b (is-not-eq-p 'a) x :count 2 :from-end t))    (let ((x (copy-seq #(a b a c)))) (nsubstitute-if-not 'b (is-not-eql-p 'a) x :count 2 :from-end t))
154    #(b b b c))    #(b b b c))
155    
156  (deftest nsubstitute-if-not-vector.12  (deftest nsubstitute-if-not-vector.12
157    (let ((x (copy-seq #(a b a c)))) (nsubstitute-if-not 'b (is-not-eq-p 'a) x :count 1 :from-end t))    (let ((x (copy-seq #(a b a c)))) (nsubstitute-if-not 'b (is-not-eql-p 'a) x :count 1 :from-end t))
158    #(a b b c))    #(a b b c))
159    
160  (deftest nsubstitute-if-not-vector.13  (deftest nsubstitute-if-not-vector.13
161    (let ((x (copy-seq #(a b a c)))) (nsubstitute-if-not 'b (is-not-eq-p 'a) x :count 0 :from-end t))    (let ((x (copy-seq #(a b a c)))) (nsubstitute-if-not 'b (is-not-eql-p 'a) x :count 0 :from-end t))
162    #(a b a c))    #(a b a c))
163    
164  (deftest nsubstitute-if-not-vector.14  (deftest nsubstitute-if-not-vector.14
165    (let ((x (copy-seq #(a b a c)))) (nsubstitute-if-not 'b (is-not-eq-p 'a) x :count -1 :from-end t))    (let ((x (copy-seq #(a b a c)))) (nsubstitute-if-not 'b (is-not-eql-p 'a) x :count -1 :from-end t))
166    #(a b a c))    #(a b a c))
167    
168  (deftest nsubstitute-if-not-vector.15  (deftest nsubstitute-if-not-vector.15
# Line 170  Line 170 
170          (loop for j from i to 10 always          (loop for j from i to 10 always
171                (let* ((orig #(a a a a a a a a a a))                (let* ((orig #(a a a a a a a a a a))
172                       (x (copy-seq orig))                       (x (copy-seq orig))
173                       (y (nsubstitute-if-not 'x (is-not-eq-p 'a) x :start i :end j)))                       (y (nsubstitute-if-not 'x (is-not-eql-p 'a) x :start i :end j)))
174                  (equalp y (concatenate 'simple-vector                  (equalp y (concatenate 'simple-vector
175                                         (make-array i :initial-element 'a)                                         (make-array i :initial-element 'a)
176                                         (make-array (- j i) :initial-element 'x)                                         (make-array (- j i) :initial-element 'x)
# Line 182  Line 182 
182          (loop for j from i to 10 always          (loop for j from i to 10 always
183                (let* ((orig #(a a a a a a a a a a))                (let* ((orig #(a a a a a a a a a a))
184                       (x (copy-seq orig))                       (x (copy-seq orig))
185                       (y (nsubstitute-if-not 'x (is-not-eq-p 'a) x :start i :end j :from-end t)))                       (y (nsubstitute-if-not 'x (is-not-eql-p 'a) x :start i :end j :from-end t)))
186                  (equalp y (concatenate 'simple-vector                  (equalp y (concatenate 'simple-vector
187                                         (make-array i :initial-element 'a)                                         (make-array i :initial-element 'a)
188                                         (make-array (- j i) :initial-element 'x)                                         (make-array (- j i) :initial-element 'x)
# Line 195  Line 195 
195                (loop for c from 0 to (- j i) always                (loop for c from 0 to (- j i) always
196                      (let* ((orig #(a a a a a a a a a a))                      (let* ((orig #(a a a a a a a a a a))
197                             (x (copy-seq orig))                             (x (copy-seq orig))
198                             (y (nsubstitute-if-not 'x (is-not-eq-p 'a) x :start i :end j :count c)))                             (y (nsubstitute-if-not 'x (is-not-eql-p 'a) x :start i :end j :count c)))
199                        (equalp y (concatenate 'simple-vector                        (equalp y (concatenate 'simple-vector
200                                               (make-array i :initial-element 'a)                                               (make-array i :initial-element 'a)
201                                               (make-array c :initial-element 'x)                                               (make-array c :initial-element 'x)
# Line 208  Line 208 
208                (loop for c from 0 to (- j i) always                (loop for c from 0 to (- j i) always
209                      (let* ((orig #(a a a a a a a a a a))                      (let* ((orig #(a a a a a a a a a a))
210                             (x (copy-seq orig))                             (x (copy-seq orig))
211                             (y (nsubstitute-if-not 'x (is-not-eq-p 'a) x :start i :end j :count c :from-end t)))                             (y (nsubstitute-if-not 'x (is-not-eql-p 'a) x :start i :end j :count c :from-end t)))
212                        (equalp y (concatenate 'simple-vector                        (equalp y (concatenate 'simple-vector
213                                               (make-array (- j c) :initial-element 'a)                                               (make-array (- j c) :initial-element 'a)
214                                               (make-array c :initial-element 'x)                                               (make-array c :initial-element 'x)
# Line 247  Line 247 
247  ;;; Tests on strings  ;;; Tests on strings
248    
249  (deftest nsubstitute-if-not-string.1  (deftest nsubstitute-if-not-string.1
250    (let ((x "")) (nsubstitute-if-not #\b (is-not-eq-p #\a) x))    (let ((x "")) (nsubstitute-if-not #\b (is-not-eql-p #\a) x))
251    "")    "")
252    
253  (deftest nsubstitute-if-not-string.2  (deftest nsubstitute-if-not-string.2
254    (let ((x (copy-seq "abac"))) (nsubstitute-if-not #\b (is-not-eq-p #\a) x))    (let ((x (copy-seq "abac"))) (nsubstitute-if-not #\b (is-not-eql-p #\a) x))
255    "bbbc")    "bbbc")
256    
257  (deftest nsubstitute-if-not-string.3  (deftest nsubstitute-if-not-string.3
258    (let ((x (copy-seq "abac"))) (nsubstitute-if-not #\b (is-not-eq-p #\a) x :count nil))    (let ((x (copy-seq "abac"))) (nsubstitute-if-not #\b (is-not-eql-p #\a) x :count nil))
259    "bbbc")    "bbbc")
260    
261  (deftest nsubstitute-if-not-string.4  (deftest nsubstitute-if-not-string.4
262    (let ((x (copy-seq "abac"))) (nsubstitute-if-not #\b (is-not-eq-p #\a) x :count 2))    (let ((x (copy-seq "abac"))) (nsubstitute-if-not #\b (is-not-eql-p #\a) x :count 2))
263    "bbbc")    "bbbc")
264    
265  (deftest nsubstitute-if-not-string.5  (deftest nsubstitute-if-not-string.5
266    (let ((x (copy-seq "abac"))) (nsubstitute-if-not #\b (is-not-eq-p #\a) x :count 1))    (let ((x (copy-seq "abac"))) (nsubstitute-if-not #\b (is-not-eql-p #\a) x :count 1))
267    "bbac")    "bbac")
268    
269  (deftest nsubstitute-if-not-string.6  (deftest nsubstitute-if-not-string.6
270    (let ((x (copy-seq "abac"))) (nsubstitute-if-not #\b (is-not-eq-p #\a) x :count 0))    (let ((x (copy-seq "abac"))) (nsubstitute-if-not #\b (is-not-eql-p #\a) x :count 0))
271    "abac")    "abac")
272    
273  (deftest nsubstitute-if-not-string.7  (deftest nsubstitute-if-not-string.7
274    (let ((x (copy-seq "abac"))) (nsubstitute-if-not #\b (is-not-eq-p #\a) x :count -1))    (let ((x (copy-seq "abac"))) (nsubstitute-if-not #\b (is-not-eql-p #\a) x :count -1))
275    "abac")    "abac")
276    
277  (deftest nsubstitute-if-not-string.8  (deftest nsubstitute-if-not-string.8
278    (let ((x "")) (nsubstitute-if-not #\b (is-not-eq-p #\a) x :from-end t))    (let ((x "")) (nsubstitute-if-not #\b (is-not-eql-p #\a) x :from-end t))
279    "")    "")
280    
281  (deftest nsubstitute-if-not-string.9  (deftest nsubstitute-if-not-string.9
282    (let ((x (copy-seq "abac"))) (nsubstitute-if-not #\b (is-not-eq-p #\a) x :from-end t))    (let ((x (copy-seq "abac"))) (nsubstitute-if-not #\b (is-not-eql-p #\a) x :from-end t))
283    "bbbc")    "bbbc")
284    
285  (deftest nsubstitute-if-not-string.10  (deftest nsubstitute-if-not-string.10
286    (let ((x (copy-seq "abac"))) (nsubstitute-if-not #\b (is-not-eq-p #\a) x :from-end t :count nil))    (let ((x (copy-seq "abac"))) (nsubstitute-if-not #\b (is-not-eql-p #\a) x :from-end t :count nil))
287    "bbbc")    "bbbc")
288    
289  (deftest nsubstitute-if-not-string.11  (deftest nsubstitute-if-not-string.11
290    (let ((x (copy-seq "abac"))) (nsubstitute-if-not #\b (is-not-eq-p #\a) x :count 2 :from-end t))    (let ((x (copy-seq "abac"))) (nsubstitute-if-not #\b (is-not-eql-p #\a) x :count 2 :from-end t))
291    "bbbc")    "bbbc")
292    
293  (deftest nsubstitute-if-not-string.12  (deftest nsubstitute-if-not-string.12
294    (let ((x (copy-seq "abac"))) (nsubstitute-if-not #\b (is-not-eq-p #\a) x :count 1 :from-end t))    (let ((x (copy-seq "abac"))) (nsubstitute-if-not #\b (is-not-eql-p #\a) x :count 1 :from-end t))
295    "abbc")    "abbc")
296    
297  (deftest nsubstitute-if-not-string.13  (deftest nsubstitute-if-not-string.13
298    (let ((x (copy-seq "abac"))) (nsubstitute-if-not #\b (is-not-eq-p #\a) x :count 0 :from-end t))    (let ((x (copy-seq "abac"))) (nsubstitute-if-not #\b (is-not-eql-p #\a) x :count 0 :from-end t))
299    "abac")    "abac")
300    
301  (deftest nsubstitute-if-not-string.14  (deftest nsubstitute-if-not-string.14
302    (let ((x (copy-seq "abac"))) (nsubstitute-if-not #\b (is-not-eq-p #\a) x :count -1 :from-end t))    (let ((x (copy-seq "abac"))) (nsubstitute-if-not #\b (is-not-eql-p #\a) x :count -1 :from-end t))
303    "abac")    "abac")
304    
305  (deftest nsubstitute-if-not-string.15  (deftest nsubstitute-if-not-string.15
# Line 307  Line 307 
307          (loop for j from i to 10 always          (loop for j from i to 10 always
308                (let* ((orig "aaaaaaaaaa")                (let* ((orig "aaaaaaaaaa")
309                       (x (copy-seq orig))                       (x (copy-seq orig))
310                       (y (nsubstitute-if-not #\x (is-not-eq-p #\a) x :start i :end j)))                       (y (nsubstitute-if-not #\x (is-not-eql-p #\a) x :start i :end j)))
311                  (equalp y (concatenate 'simple-string                  (equalp y (concatenate 'simple-string
312                                         (make-array i :initial-element #\a)                                         (make-array i :initial-element #\a)
313                                         (make-array (- j i) :initial-element #\x)                                         (make-array (- j i) :initial-element #\x)
# Line 319  Line 319 
319          (loop for j from i to 10 always          (loop for j from i to 10 always
320                (let* ((orig "aaaaaaaaaa")                (let* ((orig "aaaaaaaaaa")
321                       (x (copy-seq orig))                       (x (copy-seq orig))
322                       (y (nsubstitute-if-not #\x (is-not-eq-p #\a) x :start i :end j :from-end t)))                       (y (nsubstitute-if-not #\x (is-not-eql-p #\a) x :start i :end j :from-end t)))
323                  (equalp y (concatenate 'simple-string                  (equalp y (concatenate 'simple-string
324                                         (make-array i :initial-element #\a)                                         (make-array i :initial-element #\a)
325                                         (make-array (- j i) :initial-element #\x)                                         (make-array (- j i) :initial-element #\x)
# Line 332  Line 332 
332                (loop for c from 0 to (- j i) always                (loop for c from 0 to (- j i) always
333                      (let* ((orig "aaaaaaaaaa")                      (let* ((orig "aaaaaaaaaa")
334                             (x (copy-seq orig))                             (x (copy-seq orig))
335                             (y (nsubstitute-if-not #\x (is-not-eq-p #\a) x :start i :end j :count c)))                             (y (nsubstitute-if-not #\x (is-not-eql-p #\a) x :start i :end j :count c)))
336                        (equalp y (concatenate 'simple-string                        (equalp y (concatenate 'simple-string
337                                               (make-array i :initial-element #\a)                                               (make-array i :initial-element #\a)
338                                               (make-array c :initial-element #\x)                                               (make-array c :initial-element #\x)
# Line 345  Line 345 
345                (loop for c from 0 to (- j i) always                (loop for c from 0 to (- j i) always
346                      (let* ((orig "aaaaaaaaaa")                      (let* ((orig "aaaaaaaaaa")
347                             (x (copy-seq orig))                             (x (copy-seq orig))
348                             (y (nsubstitute-if-not #\x (is-not-eq-p #\a) x :start i :end j :count c :from-end t)))                             (y (nsubstitute-if-not #\x (is-not-eql-p #\a) x :start i :end j :count c :from-end t)))
349                        (equalp y (concatenate 'simple-string                        (equalp y (concatenate 'simple-string
350                                               (make-array (- j c) :initial-element #\a)                                               (make-array (- j c) :initial-element #\a)
351                                               (make-array c :initial-element #\x)                                               (make-array c :initial-element #\x)
# Line 387  Line 387 
387  (deftest nsubstitute-if-not-bit-vector.1  (deftest nsubstitute-if-not-bit-vector.1
388    (let* ((orig #*)    (let* ((orig #*)
389           (x (copy-seq orig))           (x (copy-seq orig))
390           (result (nsubstitute-if-not 0 (is-not-eq-p 1) x)))           (result (nsubstitute-if-not 0 (is-not-eql-p 1) x)))
391      result)      result)
392    #*)    #*)
393    
394  (deftest nsubstitute-if-not-bit-vector.2  (deftest nsubstitute-if-not-bit-vector.2
395    (let* ((orig #*)    (let* ((orig #*)
396           (x (copy-seq orig))           (x (copy-seq orig))
397           (result (nsubstitute-if-not 1 (is-not-eq-p 0) x)))           (result (nsubstitute-if-not 1 (is-not-eql-p 0) x)))
398      result)      result)
399    #*)    #*)
400    
401  (deftest nsubstitute-if-not-bit-vector.3  (deftest nsubstitute-if-not-bit-vector.3
402    (let* ((orig #*010101)    (let* ((orig #*010101)
403           (x (copy-seq orig))           (x (copy-seq orig))
404           (result (nsubstitute-if-not 0 (is-not-eq-p 1) x)))           (result (nsubstitute-if-not 0 (is-not-eql-p 1) x)))
405      result)      result)
406    #*000000)    #*000000)
407    
408  (deftest nsubstitute-if-not-bit-vector.4  (deftest nsubstitute-if-not-bit-vector.4
409    (let* ((orig #*010101)    (let* ((orig #*010101)
410           (x (copy-seq orig))           (x (copy-seq orig))
411           (result (nsubstitute-if-not 1 (is-not-eq-p 0) x)))           (result (nsubstitute-if-not 1 (is-not-eql-p 0) x)))
412      result)      result)
413    #*111111)    #*111111)
414    
415  (deftest nsubstitute-if-not-bit-vector.5  (deftest nsubstitute-if-not-bit-vector.5
416    (let* ((orig #*010101)    (let* ((orig #*010101)
417           (x (copy-seq orig))           (x (copy-seq orig))
418           (result (nsubstitute-if-not 1 (is-not-eq-p 0) x :start 1)))           (result (nsubstitute-if-not 1 (is-not-eql-p 0) x :start 1)))
419      result)      result)
420    #*011111)    #*011111)
421        
422  (deftest nsubstitute-if-not-bit-vector.6  (deftest nsubstitute-if-not-bit-vector.6
423    (let* ((orig #*010101)    (let* ((orig #*010101)
424           (x (copy-seq orig))           (x (copy-seq orig))
425           (result (nsubstitute-if-not 0 (is-not-eq-p 1) x :start 2 :end nil)))           (result (nsubstitute-if-not 0 (is-not-eql-p 1) x :start 2 :end nil)))
426      result)      result)
427    #*010000)    #*010000)
428    
429  (deftest nsubstitute-if-not-bit-vector.7  (deftest nsubstitute-if-not-bit-vector.7
430    (let* ((orig #*010101)    (let* ((orig #*010101)
431           (x (copy-seq orig))           (x (copy-seq orig))
432           (result (nsubstitute-if-not 1 (is-not-eq-p 0) x :end 4)))           (result (nsubstitute-if-not 1 (is-not-eql-p 0) x :end 4)))
433      result)      result)
434    #*111101)    #*111101)
435        
436  (deftest nsubstitute-if-not-bit-vector.8  (deftest nsubstitute-if-not-bit-vector.8
437    (let* ((orig #*010101)    (let* ((orig #*010101)
438           (x (copy-seq orig))           (x (copy-seq orig))
439           (result (nsubstitute-if-not 0 (is-not-eq-p 1) x :end nil)))           (result (nsubstitute-if-not 0 (is-not-eql-p 1) x :end nil)))
440      result)      result)
441    #*000000)    #*000000)
442    
443  (deftest nsubstitute-if-not-bit-vector.9  (deftest nsubstitute-if-not-bit-vector.9
444    (let* ((orig #*010101)    (let* ((orig #*010101)
445           (x (copy-seq orig))           (x (copy-seq orig))
446           (result (nsubstitute-if-not 0 (is-not-eq-p 1) x :end 3)))           (result (nsubstitute-if-not 0 (is-not-eql-p 1) x :end 3)))
447      result)      result)
448    #*000101)    #*000101)
449    
450  (deftest nsubstitute-if-not-bit-vector.10  (deftest nsubstitute-if-not-bit-vector.10
451    (let* ((orig #*010101)    (let* ((orig #*010101)
452           (x (copy-seq orig))           (x (copy-seq orig))
453           (result (nsubstitute-if-not 0 (is-not-eq-p 1) x :start 2 :end 4)))           (result (nsubstitute-if-not 0 (is-not-eql-p 1) x :start 2 :end 4)))
454      result)      result)
455    #*010001)    #*010001)
456    
457  (deftest nsubstitute-if-not-bit-vector.11  (deftest nsubstitute-if-not-bit-vector.11
458    (let* ((orig #*010101)    (let* ((orig #*010101)
459           (x (copy-seq orig))           (x (copy-seq orig))
460           (result (nsubstitute-if-not 1 (is-not-eq-p 0) x :start 2 :end 4)))           (result (nsubstitute-if-not 1 (is-not-eql-p 0) x :start 2 :end 4)))
461      result)      result)
462    #*011101)    #*011101)
463    
464  (deftest nsubstitute-if-not-bit-vector.12  (deftest nsubstitute-if-not-bit-vector.12
465    (let* ((orig #*010101)    (let* ((orig #*010101)
466           (x (copy-seq orig))           (x (copy-seq orig))
467           (result (nsubstitute-if-not 1 (is-not-eq-p 0) x :count 1)))           (result (nsubstitute-if-not 1 (is-not-eql-p 0) x :count 1)))
468      result)      result)
469    #*110101)    #*110101)
470    
471  (deftest nsubstitute-if-not-bit-vector.13  (deftest nsubstitute-if-not-bit-vector.13
472    (let* ((orig #*010101)    (let* ((orig #*010101)
473           (x (copy-seq orig))           (x (copy-seq orig))
474           (result (nsubstitute-if-not 1 (is-not-eq-p 0) x :count 0)))           (result (nsubstitute-if-not 1 (is-not-eql-p 0) x :count 0)))
475      result)      result)
476    #*010101)    #*010101)
477    
478  (deftest nsubstitute-if-not-bit-vector.14  (deftest nsubstitute-if-not-bit-vector.14
479    (let* ((orig #*010101)    (let* ((orig #*010101)
480           (x (copy-seq orig))           (x (copy-seq orig))
481           (result (nsubstitute-if-not 1 (is-not-eq-p 0) x :count -1)))           (result (nsubstitute-if-not 1 (is-not-eql-p 0) x :count -1)))
482      result)      result)
483    #*010101)    #*010101)
484    
485  (deftest nsubstitute-if-not-bit-vector.15  (deftest nsubstitute-if-not-bit-vector.15
486    (let* ((orig #*010101)    (let* ((orig #*010101)
487           (x (copy-seq orig))           (x (copy-seq orig))
488           (result (nsubstitute-if-not 1 (is-not-eq-p 0) x :count 1 :from-end t)))           (result (nsubstitute-if-not 1 (is-not-eql-p 0) x :count 1 :from-end t)))
489      result)      result)
490    #*010111)    #*010111)
491    
492  (deftest nsubstitute-if-not-bit-vector.16  (deftest nsubstitute-if-not-bit-vector.16
493    (let* ((orig #*010101)    (let* ((orig #*010101)
494           (x (copy-seq orig))           (x (copy-seq orig))
495           (result (nsubstitute-if-not 1 (is-not-eq-p 0) x :count 0 :from-end t)))           (result (nsubstitute-if-not 1 (is-not-eql-p 0) x :count 0 :from-end t)))
496      result)      result)
497    #*010101)    #*010101)
498    
499  (deftest nsubstitute-if-not-bit-vector.17  (deftest nsubstitute-if-not-bit-vector.17
500    (let* ((orig #*010101)    (let* ((orig #*010101)
501           (x (copy-seq orig))           (x (copy-seq orig))
502           (result (nsubstitute-if-not 1 (is-not-eq-p 0) x :count -1 :from-end t)))           (result (nsubstitute-if-not 1 (is-not-eql-p 0) x :count -1 :from-end t)))
503      result)      result)
504    #*010101)    #*010101)
505    
506  (deftest nsubstitute-if-not-bit-vector.18  (deftest nsubstitute-if-not-bit-vector.18
507    (let* ((orig #*010101)    (let* ((orig #*010101)
508           (x (copy-seq orig))           (x (copy-seq orig))
509           (result (nsubstitute-if-not 1 (is-not-eq-p 0) x :count nil)))           (result (nsubstitute-if-not 1 (is-not-eql-p 0) x :count nil)))
510      result)      result)
511    #*111111)    #*111111)
512    
513  (deftest nsubstitute-if-not-bit-vector.19  (deftest nsubstitute-if-not-bit-vector.19
514    (let* ((orig #*010101)    (let* ((orig #*010101)
515           (x (copy-seq orig))           (x (copy-seq orig))
516           (result (nsubstitute-if-not 1 (is-not-eq-p 0) x :count nil :from-end t)))           (result (nsubstitute-if-not 1 (is-not-eql-p 0) x :count nil :from-end t)))
517      result)      result)
518    #*111111)    #*111111)
519    
# Line 523  Line 523 
523                (loop for c from 0 to (- j i) always                (loop for c from 0 to (- j i) always
524                      (let* ((orig #*0000000000)                      (let* ((orig #*0000000000)
525                             (x (copy-seq orig))                             (x (copy-seq orig))
526                             (y (nsubstitute-if-not 1 (is-not-eq-p 0) x :start i :end j :count c)))                             (y (nsubstitute-if-not 1 (is-not-eql-p 0) x :start i :end j :count c)))
527                        (equalp y (concatenate                        (equalp y (concatenate
528                                   'simple-bit-vector                                   'simple-bit-vector
529                                   (make-list i :initial-element 0)                                   (make-list i :initial-element 0)
# Line 537  Line 537 
537                (loop for c from 0 to (- j i) always                (loop for c from 0 to (- j i) always
538                      (let* ((orig #*1111111111)                      (let* ((orig #*1111111111)
539                             (x (copy-seq orig))                             (x (copy-seq orig))
540                             (y (nsubstitute-if-not 0 (is-not-eq-p 1) x :start i :end j :count c :from-end t)))                             (y (nsubstitute-if-not 0 (is-not-eql-p 1) x :start i :end j :count c :from-end t)))
541                        (equalp y (concatenate                        (equalp y (concatenate
542                                   'simple-bit-vector                                   'simple-bit-vector
543                                   (make-list (- j c) :initial-element 1)                                   (make-list (- j c) :initial-element 1)
# Line 551  Line 551 
551  (deftest nsubstitute-if-not-list.24  (deftest nsubstitute-if-not-list.24
552    (let* ((orig '((a 1) (b 2) (a 3) (c 4) (d 5) (a 6) (e 7)))    (let* ((orig '((a 1) (b 2) (a 3) (c 4) (d 5) (a 6) (e 7)))
553           (x (copy-seq orig))           (x (copy-seq orig))
554           (result (nsubstitute-if-not '(a 10) (is-not-eq-p 'a) x :key #'car)))           (result (nsubstitute-if-not '(a 10) (is-not-eql-p 'a) x :key #'car)))
555      result)      result)
556    ((a 10) (b 2) (a 10) (c 4) (d 5) (a 10) (e 7)))    ((a 10) (b 2) (a 10) (c 4) (d 5) (a 10) (e 7)))
557    
558  (deftest nsubstitute-if-not-list.25  (deftest nsubstitute-if-not-list.25
559    (let* ((orig '((a 1) (b 2) (a 3) (c 4) (d 5) (a 6) (e 7)))    (let* ((orig '((a 1) (b 2) (a 3) (c 4) (d 5) (a 6) (e 7)))
560           (x (copy-seq orig))           (x (copy-seq orig))
561           (result (nsubstitute-if-not '(a 10) (is-not-eq-p 'a) x           (result (nsubstitute-if-not '(a 10) (is-not-eql-p 'a) x
562                                  :key #'car :start 1 :end 5)))                                  :key #'car :start 1 :end 5)))
563      result)      result)
564    ((a 1) (b 2) (a 10) (c 4) (d 5) (a 6) (e 7)))    ((a 1) (b 2) (a 10) (c 4) (d 5) (a 6) (e 7)))
# Line 566  Line 566 
566  (deftest nsubstitute-if-not-vector.24  (deftest nsubstitute-if-not-vector.24
567    (let* ((orig #((a 1) (b 2) (a 3) (c 4) (d 5) (a 6) (e 7)))    (let* ((orig #((a 1) (b 2) (a 3) (c 4) (d 5) (a 6) (e 7)))
568           (x (copy-seq orig))           (x (copy-seq orig))
569           (result (nsubstitute-if-not '(a 10) (is-not-eq-p 'a) x :key #'car)))           (result (nsubstitute-if-not '(a 10) (is-not-eql-p 'a) x :key #'car)))
570      result)      result)
571    #((a 10) (b 2) (a 10) (c 4) (d 5) (a 10) (e 7)))    #((a 10) (b 2) (a 10) (c 4) (d 5) (a 10) (e 7)))
572            
573  (deftest nsubstitute-if-not-vector.25  (deftest nsubstitute-if-not-vector.25
574    (let* ((orig #((a 1) (b 2) (a 3) (c 4) (d 5) (a 6) (e 7)))    (let* ((orig #((a 1) (b 2) (a 3) (c 4) (d 5) (a 6) (e 7)))
575           (x (copy-seq orig))           (x (copy-seq orig))
576           (result (nsubstitute-if-not '(a 10) (is-not-eq-p 'a) x :key #'car :start 1 :end 5)))           (result (nsubstitute-if-not '(a 10) (is-not-eql-p 'a) x :key #'car :start 1 :end 5)))
577      result)      result)
578    #((a 1) (b 2) (a 10) (c 4) (d 5) (a 6) (e 7)))    #((a 1) (b 2) (a 10) (c 4) (d 5) (a 6) (e 7)))
579    
580  (deftest nsubstitute-if-not-string.24  (deftest nsubstitute-if-not-string.24
581    (let* ((orig "0102342015")    (let* ((orig "0102342015")
582           (x (copy-seq orig))           (x (copy-seq orig))
583           (result (nsubstitute-if-not #\a (is-not-eq-p #\1) x :key #'nextdigit)))           (result (nsubstitute-if-not #\a (is-not-eql-p #\1) x :key #'nextdigit)))
584      result)      result)
585    "a1a2342a15")    "a1a2342a15")
586            
587  (deftest nsubstitute-if-not-string.25  (deftest nsubstitute-if-not-string.25
588    (let* ((orig "0102342015")    (let* ((orig "0102342015")
589           (x (copy-seq orig))           (x (copy-seq orig))
590           (result (nsubstitute-if-not #\a (is-not-eq-p #\1) x :key #'nextdigit :start 1 :end 6)))           (result (nsubstitute-if-not #\a (is-not-eql-p #\1) x :key #'nextdigit :start 1 :end 6)))
591      result)      result)
592    "01a2342015")    "01a2342015")
593    
594  (deftest nsubstitute-if-not-bit-vector.26  (deftest nsubstitute-if-not-bit-vector.26
595    (let* ((orig #*00111001011010110)    (let* ((orig #*00111001011010110)
596           (x (copy-seq orig))           (x (copy-seq orig))
597           (result (nsubstitute-if-not 1 (is-not-eq-p 1) x :key #'1+)))           (result (nsubstitute-if-not 1 (is-not-eql-p 1) x :key #'1+)))
598      result)      result)
599    #*11111111111111111)    #*11111111111111111)
600            
601  (deftest nsubstitute-if-not-bit-vector.27  (deftest nsubstitute-if-not-bit-vector.27
602    (let* ((orig #*00111001011010110)    (let* ((orig #*00111001011010110)
603           (x (copy-seq orig))           (x (copy-seq orig))
604           (result (nsubstitute-if-not 1 (is-not-eq-p 1) x :key #'1+ :start 1 :end 10)))           (result (nsubstitute-if-not 1 (is-not-eql-p 1) x :key #'1+ :start 1 :end 10)))
605      result)      result)
606    #*01111111111010110)    #*01111111111010110)
607    

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

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