math-utils-test.scm 557 B

123456789101112131415161718192021222324252627282930313233
  1. (use-modules
  2. ;; SRFI 64 for unit testing facilities
  3. (srfi srfi-64)
  4. ;; utils - the code to be tested
  5. (utils math))
  6. (test-begin "math-utils-test")
  7. (test-group
  8. "exact-floor"
  9. (test-equal "exact-floor with positive number"
  10. 1
  11. (exact-floor 1.3))
  12. (test-equal "exact-floor with negative number"
  13. -3
  14. (exact-floor -2.9)))
  15. (test-group
  16. "exact-ceiling"
  17. (test-equal "exact-ceiling with positive number"
  18. 2
  19. (exact-ceiling 1.3))
  20. (test-equal "exact-ceiling with negative number"
  21. -2
  22. (exact-ceiling -2.9)))
  23. (test-end "math-utils-test")