/[gcl]/gcl/ansi-tests/find.lsp
ViewVC logotype

Diff of /gcl/ansi-tests/find.lsp

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

revision 1.3 by pfdietz, Wed Oct 23 03:10:23 2002 UTC revision 1.4 by pfdietz, Mon Nov 4 04:31:48 2002 UTC
# Line 305  Line 305 
305              :start 2 :from-end t)              :start 2 :from-end t)
306    (a b))    (a b))
307    
308    (deftest find-vector.29
309      (let ((a (make-array '(10)
310                           :initial-contents '(1 2 3 4 5 6 7 8 9 10)
311                           :fill-pointer 5)))
312        (loop for i from 1 to 10 collect (find i a)))
313      (1 2 3 4 5 nil nil nil nil nil))
314    
315    (deftest find-vector.30
316      (let ((a (make-array '(10)
317                           :initial-contents (loop for i from 1 for e in '(1 2 3 4 5 5 4 3 2 1)
318                                                   collect (list e i))
319                           :fill-pointer 5)))
320        (loop for i from 1 to 5 collect (find i a :from-end t :key #'car)))
321      ((1 1) (2 2) (3 3) (4 4) (5 5)))
322    
323  ;;; tests on bit vectors  ;;; tests on bit vectors
324    
325  (deftest find-bit-vector.1  (deftest find-bit-vector.1
# Line 562  Line 577 
577              :start 2 :from-end t)              :start 2 :from-end t)
578    nil)    nil)
579    
580    (deftest find-bit-vector.29
581      (let ((a
582             (make-array '(10) :initial-contents '(1 1 1 1 1 0 0 0 0 0)
583                         :element-type 'bit
584                         :fill-pointer 5)))
585        (values (find 0 a)
586                (find 0 a :from-end t)))
587      nil nil)
588    
589    (deftest find-bit-vector.30
590      (let ((a (make-array '(10) :initial-contents '(1 1 1 1 0 0 0 0 0 0)
591                           :element-type 'bit
592                           :fill-pointer 5)))
593        (values (find 0 a) (find 0 a :from-end t)))
594      0 0)
595    
596  ;;; strings  ;;; strings
597    
598  (deftest find-string.1  (deftest find-string.1
# Line 698  Line 729 
729          :start 0 :end 5 :from-end t)          :start 0 :end 5 :from-end t)
730    #\c)    #\c)
731    
732    (deftest find-string.25
733      (let ((s (make-array '(10) :initial-contents (coerce "abcdefghij" 'list)
734                           :element-type 'character
735                           :fill-pointer 5)))
736        (values
737         (loop for e across "abcdefghij"
738               collect (find e s))
739         (loop for e across "abcdefghij"
740               collect (find e s :from-end t))))
741      (#\a #\b #\c #\d #\e nil nil nil nil nil)
742      (#\a #\b #\c #\d #\e nil nil nil nil nil))
743    
744  ;;; Error tests  ;;; Error tests
745    
746  (deftest find-error.1  (deftest find-error.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