1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-21 12:10:26 +02:00

(fifth, sixth, seventh, eighth, ninth, tenth): New tests.

This commit is contained in:
Kevin Ryde 2005-05-03 23:25:48 +00:00
parent 03731332d5
commit f1f478bf1d

View file

@ -836,6 +836,26 @@
(pass-if (equal? '(4 3) (drop-while odd? '(1 4 3))))
(pass-if (equal? '(4 1 3) (drop-while odd? '(4 1 3)))))
;;
;; eighth
;;
(with-test-prefix "eighth"
(pass-if-exception "() -1" exception:out-of-range
(eighth '(a b c d e f g)))
(pass-if (eq? 'h (eighth '(a b c d e f g h))))
(pass-if (eq? 'h (eighth '(a b c d e f g h i)))))
;;
;; fifth
;;
(with-test-prefix "fifth"
(pass-if-exception "() -1" exception:out-of-range
(fifth '(a b c d)))
(pass-if (eq? 'e (fifth '(a b c d e))))
(pass-if (eq? 'e (fifth '(a b c d e f)))))
;;
;; filter-map
;;
@ -1279,6 +1299,16 @@
(eqv? 2 y)))))
good)))
;;
;; ninth
;;
(with-test-prefix "ninth"
(pass-if-exception "() -1" exception:out-of-range
(ninth '(a b c d e f g h)))
(pass-if (eq? 'i (ninth '(a b c d e f g h i))))
(pass-if (eq? 'i (ninth '(a b c d e f g h i j)))))
;;
;; take
;;
@ -1631,6 +1661,26 @@
(pass-if (equal? '(2 6) (remove! odd? (list 1 2 6))))
(pass-if (equal? '(2 4 6) (remove! odd? (list 2 4 6)))))
;;
;; seventh
;;
(with-test-prefix "seventh"
(pass-if-exception "() -1" exception:out-of-range
(seventh '(a b c d e f)))
(pass-if (eq? 'g (seventh '(a b c d e f g))))
(pass-if (eq? 'g (seventh '(a b c d e f g h)))))
;;
;; sixth
;;
(with-test-prefix "sixth"
(pass-if-exception "() -1" exception:out-of-range
(sixth '(a b c d e)))
(pass-if (eq? 'f (sixth '(a b c d e f))))
(pass-if (eq? 'f (sixth '(a b c d e f g)))))
;;
;; split-at
;;
@ -1906,4 +1956,12 @@
(pass-if-exception "(4 5 6) 4" exception:wrong-type-arg
(take-right '(4 5 6) 4)))
;;
;; tenth
;;
(with-test-prefix "tenth"
(pass-if-exception "() -1" exception:out-of-range
(tenth '(a b c d e f g h i)))
(pass-if (eq? 'j (tenth '(a b c d e f g h i j))))
(pass-if (eq? 'j (tenth '(a b c d e f g h i j k)))))