summaryrefslogtreecommitdiffstats
path: root/srfi-225-test.scm
diff options
context:
space:
mode:
authorGravatar Arvydas Silanskas 2022-08-06 11:35:06 +0300
committerGravatar Arvydas Silanskas 2022-08-06 11:35:06 +0300
commitfd4585b6e0ac67ae9591a4183fb7c82ed3a30218 (patch)
tree8da6ad7744c6b26cbcf3acdd7d08e83c33c5e014 /srfi-225-test.scm
parentMerge branch 'master' of https://github.com/johnwcowan/srfi-225 (diff)
return alists; refactor structure
Diffstat (limited to 'srfi-225-test.scm')
-rw-r--r--srfi-225-test.scm59
1 files changed, 14 insertions, 45 deletions
diff --git a/srfi-225-test.scm b/srfi-225-test.scm
index 5f4553a..4967f94 100644
--- a/srfi-225-test.scm
+++ b/srfi-225-test.scm
@@ -859,59 +859,28 @@
"default"
;; test defaults by overring only procedures that raise error otherwise
- (define (alist-find-update dto alist key failure success)
- (define (handle-success pair)
- (define old-key (car pair))
- (define old-value (cdr pair))
- (define (update new-key new-value)
- (cond
- ((and (eq? old-key
- new-key)
- (eq? old-value
- new-value))
- alist)
- (else
- (let ((new-list
- (alist-cons
- new-key new-value
- (alist-delete old-key alist))))
- new-list))))
- (define (remove)
- (alist-delete old-key alist))
- (success old-key old-value update remove))
-
- (define (handle-failure)
- (define (insert value)
- (alist-cons key value alist))
- (define (ignore)
- alist)
- (failure insert ignore))
- (cond
- ((assoc key alist equal?) => handle-success)
- (else (handle-failure))))
-
- (define (alist-map dto proc alist)
- (map
- (lambda (e)
- (define key (car e))
- (define value (cdr e))
- (cons key (proc key value)))
- alist))
-
(define minimal-alist-dto
(make-dto
- dictionary?-id (lambda (dto obj) (list? obj))
- dict-pure?-id (lambda _ #t)
- dict-size-id (lambda (dto alist) (length alist))
- dict-find-update-id alist-find-update
- dict-map-id alist-map
- dict-comparator-id (lambda _ #f)))
+ dictionary?-id (dto-ref equal-alist-dto dictionary?-id)
+ dict-pure?-id (dto-ref equal-alist-dto dict-pure?-id)
+ dict-size-id (dto-ref equal-alist-dto dict-size-id)
+ dict-find-update-id (dto-ref equal-alist-dto dict-find-update-id)
+ dict-map-id (dto-ref equal-alist-dto dict-map-id)
+ dict-comparator-id (dto-ref equal-alist-dto dict-comparator-id)))
(do-test
minimal-alist-dto
alist-copy
#f
#f))
+(test-group
+ "alist"
+ (do-test
+ equal-alist-dto
+ alist-copy
+ #f
+ #f))
+
(cond-expand
((and (library (srfi 69))
(not gauche) ;; gauche has bug with comparator retrieval from srfi 69 table
01-05 20:58:19 +0000'>2003-01-05emulate legacy ISO reception API on top of new rawiso APIGravatar dmaas 7-131/+174 git-svn-id: svn://svn.linux1394.org/libraw1394/trunk@99 53a565d1-3bb7-0310-b661-cf11e63c67ab 2002-12-24update iso API for multi-channel reception and new packet buffer layoutGravatar dmaas 4-123/+236 git-svn-id: svn://svn.linux1394.org/libraw1394/trunk@98 53a565d1-3bb7-0310-b661-cf11e63c67ab 2002-12-20oops, irq_interval needs to be signedGravatar anonymous 1-1/+1 git-svn-id: svn://svn.linux1394.org/libraw1394/trunk@97 53a565d1-3bb7-0310-b661-cf11e63c67ab 2002-12-20dmaas - renamed exported arm definitions into the raw1394_ namespace; ↵Gravatar anonymous 3-124/+48 brought kernel-raw1394.h back in sync with the kernel version git-svn-id: svn://svn.linux1394.org/libraw1394/trunk@96 53a565d1-3bb7-0310-b661-cf11e63c67ab 2002-12-16rawiso updates:Gravatar dmaas 3-18/+25 - changed return type of rawiso xmit/recv handlers from int to enum raw1394_iso_disposition - added an ioctl (RAW1394_ISO_QUEUE_ACTIVITY) to force an ISO_ACTIVITY event into the queue. This is needed for handling RAW1394_ISO_DEFER, to kick us out of the next read() instead of sleeping forever. - removed references to "8-byte" isochronous header - this is an OHCI-specific implementation detail git-svn-id: svn://svn.linux1394.org/libraw1394/trunk@95 53a565d1-3bb7-0310-b661-cf11e63c67ab 2002-11-18fix cplusplus extern C blockGravatar ddennedy 1-4/+4 git-svn-id: svn://svn.linux1394.org/libraw1394/trunk@94 53a565d1-3bb7-0310-b661-cf11e63c67ab 2002-11-18merged rawiso branchGravatar ddennedy 7-6/+488 git-svn-id: svn://svn.linux1394.org/libraw1394/trunk@93 53a565d1-3bb7-0310-b661-cf11e63c67ab