12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- (import
- (except (rnrs base) map vector-map)
- (only (guile)
- lambda* λ)
- ;; SRFI 64 - unit testing forms
- (srfi srfi-64)
- ;; SRFI 43 - vector procs
- (srfi srfi-43)
- ;; SRFI 1 - list procs
- (srfi srfi-1)
- ;; module under test
- (vector-procs))
- (test-begin "vector-procs-test")
- (test-group
- "vector-update-elements-test"
- (test-equal "vector-update-elements - 01"
- #((updated-a . 1)
- (updated-b . 2)
- (c . 3))
- (let ([current
- (list->vector
- (list (cons 'a 1)
- (cons 'b 2)
- (cons 'c 3)))]
- [updates
- (list->vector
- (list (cons 'updated-b 2)
- (cons 'updated-a 1)
- (cons 'other 6)))])
- (vector-update-elements
- current
- updates
- #:should-update? (λ (a b) (equal? (cdr a) (cdr b)))
- #:update-item (λ (a b) b)))))
- (test-end "vector-procs-test")
|