diff options
| author | 2021-11-11 16:48:07 -0500 | |
|---|---|---|
| committer | 2021-11-11 16:48:07 -0500 | |
| commit | 1ff574608d023a5c98f7b30f9025c7aa7e4b53f7 (patch) | |
| tree | 2084df6c76ed4c0b7517cd299d70dd96bca55238 /srfi-225-test.scm | |
| parent | Merge remote-tracking branch 'arvyy/master' (diff) | |
| parent | comments (diff) | |
Merge remote-tracking branch 'arvyy/master'
Diffstat (limited to 'srfi-225-test.scm')
| -rw-r--r-- | srfi-225-test.scm | 67 |
1 files changed, 12 insertions, 55 deletions
diff --git a/srfi-225-test.scm b/srfi-225-test.scm index 9de1e7b..68402bc 100644 --- a/srfi-225-test.scm +++ b/srfi-225-test.scm @@ -135,34 +135,6 @@ (test-equal (dict-ref/default dtd (alist->dict '((a . b))) 'a 'c) 'b) (test-equal (dict-ref/default dtd (alist->dict '((a* . b))) 'a 'c) 'c)) - (test-group - "dict-min-key" - (define dict (alist->dict '((2 . a) (1 . b) (3 . c)))) - (call/cc (lambda (cont) - (with-exception-handler - (lambda (err) - (unless (let* ((cmp (dict-comparator dtd (alist->dict '()))) - (ordering (and cmp (comparator-ordering-predicate cmp)))) - ordering) - (cont #t))) - (lambda () - (define key (dict-min-key dtd dict)) - (test-equal 1 key)))))) - - (test-group - "dict-max-key" - (define dict (alist->dict '((2 . a) (3 . b) (1 . c)))) - (call/cc (lambda (cont) - (with-exception-handler - (lambda (err) - (unless (let* ((cmp (dict-comparator dtd (alist->dict '()))) - (ordering (and cmp (comparator-ordering-predicate cmp)))) - ordering) - (cont #t))) - (lambda () - (define key (dict-max-key dtd dict)) - (test-equal 3 key)))))) - (when mutable? (test-skip 1)) (test-group @@ -716,7 +688,7 @@ (test-group "dict-for-each<" (test-for-each (let* ((cmp (dict-comparator dtd (alist->dict '()))) - (ordering (and cmp (comparator-ordering-predicate cmp)))) + (ordering (and cmp (comparator-ordered? cmp)))) ordering) (lambda (proc) (dict-for-each< dtd @@ -731,7 +703,7 @@ (test-group "dict-for-each<=" (test-for-each (let* ((cmp (dict-comparator dtd (alist->dict '()))) - (ordering (and cmp (comparator-ordering-predicate cmp)))) + (ordering (and cmp (comparator-ordered? cmp)))) ordering) (lambda (proc) (dict-for-each<= dtd @@ -746,7 +718,7 @@ (test-group "dict-for-each>" (test-for-each (let* ((cmp (dict-comparator dtd (alist->dict '()))) - (ordering (and cmp (comparator-ordering-predicate cmp)))) + (ordering (and cmp (comparator-ordered? cmp)))) ordering) (lambda (proc) (dict-for-each> dtd @@ -761,7 +733,7 @@ (test-group "dict-for-each>=" (test-for-each (let* ((cmp (dict-comparator dtd (alist->dict '()))) - (ordering (and cmp (comparator-ordering-predicate cmp)))) + (ordering (and cmp (comparator-ordered? cmp)))) ordering) (lambda (proc) (dict-for-each>= dtd @@ -776,7 +748,7 @@ (test-group "dict-for-each-in-open-interval" (test-for-each (let* ((cmp (dict-comparator dtd (alist->dict '()))) - (ordering (and cmp (comparator-ordering-predicate cmp)))) + (ordering (and cmp (comparator-ordered? cmp)))) ordering) (lambda (proc) (dict-for-each-in-open-interval dtd @@ -791,7 +763,7 @@ (test-group "dict-for-each-in-closed-interval" (test-for-each (let* ((cmp (dict-comparator dtd (alist->dict '()))) - (ordering (and cmp (comparator-ordering-predicate cmp)))) + (ordering (and cmp (comparator-ordered? cmp)))) ordering) (lambda (proc) (dict-for-each-in-closed-interval dtd @@ -806,7 +778,7 @@ (test-group "dict-for-each-in-open-closed-interval" (test-for-each (let* ((cmp (dict-comparator dtd (alist->dict '()))) - (ordering (and cmp (comparator-ordering-predicate cmp)))) + (ordering (and cmp (comparator-ordered? cmp)))) ordering) (lambda (proc) (dict-for-each-in-open-closed-interval dtd @@ -821,7 +793,7 @@ (test-group "dict-for-each-in-closed-open-interval" (test-for-each (let* ((cmp (dict-comparator dtd (alist->dict '()))) - (ordering (and cmp (comparator-ordering-predicate cmp)))) + (ordering (and cmp (comparator-ordered? cmp)))) ordering) (lambda (proc) (dict-for-each-in-closed-open-interval dtd @@ -864,7 +836,7 @@ ;; check all procs were called (for-each (lambda (index) - (when (= 0 (vector-ref counter index)) + (when (> 0 (vector-ref counter index)) (error "Untested procedure" index))) (iota (vector-length counter)))) @@ -886,8 +858,7 @@ minimal-alist-dtd alist-copy #f - #f - )) + #f)) (test-group "alist" @@ -903,24 +874,10 @@ "alist dict-comparator" (test-assert (not (dict-comparator alist-equal-dtd '()))))) -(test-group - "plist" - (do-test - plist-dtd - (lambda (alist) - (apply append - (map (lambda (pair) - (list (car pair) (cdr pair))) - alist))) - #f - #f) - (test-group - "plist dict-comparator" - (test-assert (not (dict-comparator plist-dtd '()))))) - (cond-expand ((and (library (srfi 69)) - (not gauche)) ;; gauche has bug with comparator retrieval from srfi 69 table + (not gauche) ;; gauche has bug with comparator retrieval from srfi 69 table + ) (test-group "srfi-69" (do-test |
