test-template.scm 576 B

12345678910111213141516171819202122232425
  1. (import
  2. (scheme base)
  3. (scheme write)
  4. (srfi 64)
  5. (scheme load))
  6. (load "./solution.scm")
  7. (define test-values
  8. '(("Example 1" () 1)))
  9. (define (test-solution proc)
  10. (test-begin "Problem ~a Test Suite")
  11. (for-each (lambda (test-pair)
  12. (define name (list-ref test-pair 0))
  13. (define input (list-ref test-pair 1))
  14. (define output (list-ref test-pair 2))
  15. (define actual-output (apply proc input))
  16. (test-equal name output actual-output))
  17. test-values)
  18. (test-end))
  19. (test-solution solution~a)