test-alist-procs.scm 760 B

1234567891011121314151617181920212223242526272829303132333435
  1. (import
  2. (except (rnrs base) map)
  3. (only (guile)
  4. lambda* λ)
  5. (alist-procs)
  6. ;; SRFI 1 - list procs
  7. (srfi srfi-1)
  8. ;; SRFI 64 - unit testing forms
  9. (srfi srfi-64))
  10. (test-begin "alist-procs-test")
  11. (test-group
  12. "alist-set"
  13. (test-assert "alist-set-01"
  14. (equal? '((a . 1) (b . 4) (c . 3))
  15. (alist-set '((a . 1) (b . 2) (c . 3)) 'b 4 #:equal-test equal?)))
  16. (test-assert "alist-set-02"
  17. (equal? '((a . 1)
  18. (b . 2)
  19. (c . 3)
  20. (d . 4))
  21. (alist-set '((a . 1)
  22. (b . 2)
  23. (c . 3))
  24. 'd
  25. 4
  26. #:equal-test equal?))))
  27. ;; Finish the testsuite, and report results.
  28. (test-end "alist-procs-test")