(lset-difference, lset-difference,
authorKevin Ryde <user42@zip.com.au>
Fri, 12 Aug 2005 01:26:52 +0000 (01:26 +0000)
committerKevin Ryde <user42@zip.com.au>
Fri, 12 Aug 2005 01:26:52 +0000 (01:26 +0000)
lset-diff+intersection, lset-diff+intersection, lset-intersection):
Exercise equality procedure arg order (already correct in these procs,
but had been wrong in other lset ones).

test-suite/tests/srfi-1.test

index 04265ea..ddaab2f 100644 (file)
   (pass-if "(2) 1 1"
     (equal? '(1 2) (lset-adjoin = '(2) 1 1))))
 
+;;
+;; lset-difference
+;;
+
+(with-test-prefix "lset-difference"
+
+  (pass-if "called arg order"
+    (let ((good #f))
+      (lset-difference (lambda (x y)
+                        (set! good (and (= x 1) (= y 2)))
+                        (= x y))
+                      '(1) '(2))
+      good)))  
+
+;;
+;; lset-difference!
+;;
+
+(with-test-prefix "lset-difference"
+
+  (pass-if "called arg order"
+    (let ((good #f))
+      (lset-difference (lambda (x y)
+                        (set! good (and (= x 1) (= y 2)))
+                        (= x y))
+                      (list 1) (list 2))
+      good)))  
+
+;;
+;; lset-diff+intersection
+;;
+
+(with-test-prefix "lset-diff+intersection"
+
+  (pass-if "called arg order"
+    (let ((good #f))
+      (lset-diff+intersection (lambda (x y)
+                               (set! good (and (= x 1) (= y 2)))
+                               (= x y))
+                             '(1) '(2))
+      good)))  
+
+;;
+;; lset-diff+intersection!
+;;
+
+(with-test-prefix "lset-diff+intersection"
+
+  (pass-if "called arg order"
+    (let ((good #f))
+      (lset-diff+intersection (lambda (x y)
+                               (set! good (and (= x 1) (= y 2)))
+                               (= x y))
+                             (list 1) (list 2))
+      good)))  
+
+;;
+;; lset-intersection
+;;
+
+(with-test-prefix "lset-intersection"
+
+  (pass-if "called arg order"
+    (let ((good #f))
+      (lset-intersection (lambda (x y)
+                          (set! good (and (= x 1) (= y 2)))
+                          (= x y))
+                        '(1) '(2))
+      good)))  
+
+;;
+;; lset-intersection!
+;;
+
+(with-test-prefix "lset-intersection"
+
+  (pass-if "called arg order"
+    (let ((good #f))
+      (lset-intersection (lambda (x y)
+                          (set! good (and (= x 1) (= y 2)))
+                          (= x y))
+                        (list 1) (list 2))
+      good)))  
+
 ;;
 ;; lset-union
 ;;