... |
... |
@@ -90,35 +90,34 @@ |
90
|
90
|
|
91
|
91
|
|
92
|
92
|
(define-test nset-diff.1
|
93
|
|
- (:tags :issues)
|
|
93
|
+ (:tag :issues)
|
94
|
94
|
;; From CLHS
|
95
|
95
|
(flet
|
96
|
|
- ((test1)
|
97
|
|
- (let ((lst1 (list "A" "b" "C" "d"))
|
98
|
|
- (lst2 (list "a" "B" "C" "d")))
|
99
|
|
- (assert-equal '("b" "A")
|
100
|
|
- (nset-difference lst1 lst2 :test 'equal))
|
101
|
|
- ;; This isn't specified by the CLHS, but it is what we do.
|
102
|
|
- (assert-equal '("A") lst1)))
|
103
|
|
- (test1)
|
104
|
|
-
|
105
|
|
- (let ((lisp::*min-list-length-for-hashtable* 1))
|
106
|
|
- (test1))))
|
|
96
|
+ ((test1 (min-length-limit)
|
|
97
|
+ (let ((lisp::*min-list-length-for-hashtable* min-length-limit)
|
|
98
|
+ (lst1 (list "A" "b" "C" "d"))
|
|
99
|
+ (lst2 (list "a" "B" "C" "d")))
|
|
100
|
+ (assert-equal '("b" "A")
|
|
101
|
+ (nset-difference lst1 lst2 :test 'equal))
|
|
102
|
+ ;; This isn't specified by the CLHS, but it is what we do.
|
|
103
|
+ (assert-equal '("A") lst1))))
|
|
104
|
+ (test1 100)
|
|
105
|
+ (test1 1)))
|
107
|
106
|
|
108
|
107
|
(define-test nset-diff.key
|
109
|
|
- (:tags :issues)
|
|
108
|
+ (:tag :issues)
|
110
|
109
|
(flet
|
111
|
|
- ((test)
|
112
|
|
- ;; From CLHS
|
113
|
|
- (let ((lst1 (list '("a" . "b") '("c" . "d") '("e" . "f")))
|
114
|
|
- (lst2 (list '("c" . "a") '("e" . "b") '("d" . "a"))))
|
115
|
|
- (assert-equal '(("e" . "f" ("c" . "d")))
|
116
|
|
- (nset-difference lst1 lst2 :test 'equal :key #'cdr))
|
117
|
|
- ;; This isn't specified by the CLHS, but it is what we do.
|
118
|
|
- (assert-equal '(("a" . "b") ("c" . "d")) lst1)))
|
119
|
|
- (test)
|
120
|
|
- (let ((lisp::*min-list-length-for-hashtable* 1))
|
121
|
|
- (test))))
|
|
110
|
+ ((test (min-length-limit)
|
|
111
|
+ ;; From CLHS
|
|
112
|
+ (let ((lisp::*min-list-length-for-hashtable* min-length-limit)
|
|
113
|
+ (lst1 (list '("a" . "b") '("c" . "d") '("e" . "f")))
|
|
114
|
+ (lst2 (list '("c" . "a") '("e" . "b") '("d" . "a"))))
|
|
115
|
+ (assert-equal '(("e" . "f") ("c" . "d"))
|
|
116
|
+ (nset-difference lst1 lst2 :test 'equal :key #'cdr))
|
|
117
|
+ ;; This isn't specified by the CLHS, but it is what we do.
|
|
118
|
+ (assert-equal '(("a" . "b") ("c" . "d")) lst1))))
|
|
119
|
+ (test 100)
|
|
120
|
+ (test 1)))
|
122
|
121
|
|
123
|
122
|
(define-test union.hash-eql
|
124
|
123
|
(:tag :issues)
|
... |
... |
@@ -206,29 +205,29 @@ |
206
|
205
|
(define-test nunion.1
|
207
|
206
|
(:tag :issues)
|
208
|
207
|
(flet
|
209
|
|
- ((test)
|
210
|
|
- (let ((lst1 (list 1 2 '(1 2) "a" "b"))
|
211
|
|
- (lst2 (list 2 3 '(2 3) "B" "C")))
|
212
|
|
- (assert-equal '("b" "a" (1 2) 1 2 3 (2 3) "B" "C")
|
213
|
|
- (nunion lst1 lst2))
|
214
|
|
- (assert-equal '(1 2 3 (2 3) "B" "C")
|
215
|
|
- lst1)))
|
216
|
|
- (test)
|
217
|
|
- (let ((lisp::*min-list-length-for-hashtable* 1))
|
218
|
|
- (test))))
|
|
208
|
+ ((test (min-list-length)
|
|
209
|
+ (let ((lisp::*min-list-length-for-hashtable* min-list-length)
|
|
210
|
+ (lst1 (list 1 2 '(1 2) "a" "b"))
|
|
211
|
+ (lst2 (list 2 3 '(2 3) "B" "C")))
|
|
212
|
+ (assert-equal '("b" "a" (1 2) 1 2 3 (2 3) "B" "C")
|
|
213
|
+ (nunion lst1 lst2))
|
|
214
|
+ (assert-equal '(1 2 3 (2 3) "B" "C")
|
|
215
|
+ lst1))))
|
|
216
|
+ (test 100)
|
|
217
|
+ (test 1)))
|
219
|
218
|
|
220
|
219
|
(define-test nintersection.1
|
221
|
220
|
(:tag :issues)
|
222
|
221
|
(flet
|
223
|
|
- ((test)
|
224
|
|
- (let ((lst1 (list 1 1 2 3 4 a b c "A" "B" "C" "d"))
|
225
|
|
- (lst2 (list 1 4 5 b c d "a" "B" "c" "D")))
|
226
|
|
- (assert-equal '(c b 4 1 1)
|
227
|
|
- (nintersection lst1 lst2))
|
228
|
|
- (assert-equal '(1) lst1)))
|
229
|
|
- (test)
|
230
|
|
- (let ((lisp::*min-list-length-for-hashtable* 1))
|
231
|
|
- (test))))
|
|
222
|
+ ((test (min-list-length)
|
|
223
|
+ (let ((lisp::*min-list-length-for-hashtable* min-list-length)
|
|
224
|
+ (lst1 (list 1 1 2 3 4 'a 'b 'c "A" "B" "C" "d"))
|
|
225
|
+ (lst2 (list 1 4 5 'b 'c 'd "a" "B" "c" "D")))
|
|
226
|
+ (assert-equal '(c b 4 1 1)
|
|
227
|
+ (nintersection lst1 lst2))
|
|
228
|
+ (assert-equal '(1) lst1))))
|
|
229
|
+ (test 100)
|
|
230
|
+ (test 1)))
|
232
|
231
|
|
233
|
232
|
|
234
|
233
|
(define-test subsetp.hash-eq
|