1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-09 13:30:26 +02:00

(list-copy): New tests.

This commit is contained in:
Kevin Ryde 2003-08-22 22:57:46 +00:00
parent a54e06e5cd
commit b052db6954

View file

@ -313,6 +313,26 @@
(pass-if (not (length+ (circular-list 1 2)))) (pass-if (not (length+ (circular-list 1 2))))
(pass-if (not (length+ (circular-list 1 2 3))))) (pass-if (not (length+ (circular-list 1 2 3)))))
;;
;; list-copy
;;
(with-test-prefix "list-copy"
;; improper lists can be copied
(pass-if (equal? '() (list-copy '())))
(pass-if (equal? '(1 2) (list-copy '(1 2))))
(pass-if (equal? '(1 2 3) (list-copy '(1 2 3))))
(pass-if (equal? '(1 2 3 4) (list-copy '(1 2 3 4))))
(pass-if (equal? '(1 2 3 4 5) (list-copy '(1 2 3 4 5))))
;; improper lists can be copied
(pass-if (equal? 1 (list-copy 1)))
(pass-if (equal? '(1 . 2) (list-copy '(1 . 2))))
(pass-if (equal? '(1 2 . 3) (list-copy '(1 2 . 3))))
(pass-if (equal? '(1 2 3 . 4) (list-copy '(1 2 3 . 4))))
(pass-if (equal? '(1 2 3 4 . 5) (list-copy '(1 2 3 4 . 5)))))
;; ;;
;; take ;; take
;; ;;