mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-23 13:00:34 +02:00
(lset-adjoin): New tests.
This commit is contained in:
parent
5ef7de4fa7
commit
44a84ce09e
1 changed files with 33 additions and 0 deletions
|
@ -711,6 +711,39 @@
|
||||||
'(1 1) '(2 2) '(3 3))
|
'(1 1) '(2 2) '(3 3))
|
||||||
good))))
|
good))))
|
||||||
|
|
||||||
|
;;
|
||||||
|
;; lset-adjoin
|
||||||
|
;;
|
||||||
|
|
||||||
|
(with-test-prefix "lset-adjoin"
|
||||||
|
|
||||||
|
(pass-if "no args"
|
||||||
|
(eq? #t (lset= eq?)))
|
||||||
|
|
||||||
|
;; in guile 1.6.7 and earlier, lset-adjoin didn't actually use the given
|
||||||
|
;; `=' procedure, all comparisons were just with `equal?
|
||||||
|
;;
|
||||||
|
(with-test-prefix "case-insensitive ="
|
||||||
|
|
||||||
|
(pass-if "(\"x\") \"X\""
|
||||||
|
(equal? '("x") (lset-adjoin string-ci=? '("x") "X"))))
|
||||||
|
|
||||||
|
(pass-if "called arg order"
|
||||||
|
(let ((good #f))
|
||||||
|
(lset-adjoin (lambda (x y)
|
||||||
|
(set! good (and (= x 1) (= y 2))))
|
||||||
|
'(1) 2)
|
||||||
|
good))
|
||||||
|
|
||||||
|
(pass-if "called against arg list only"
|
||||||
|
(let ((good #t))
|
||||||
|
(lset-adjoin (lambda (x y)
|
||||||
|
(set! good (and good
|
||||||
|
(= x 1)
|
||||||
|
(or (= y 2) (= y 3)))))
|
||||||
|
'(1) 2 3)
|
||||||
|
good)))
|
||||||
|
|
||||||
;;
|
;;
|
||||||
;; map
|
;; map
|
||||||
;;
|
;;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue