12345678910111213141516171819202122232425262728 |
- (import
- (scheme base)
- (scheme write)
- (scheme load)
- (srfi 64))
- (load "./solution.scm")
- (define test-values
- '(("Example 1" (#(2 7 11 15) 9) #(0 1))
- ("Example 2" (#(3 2 4) 6) #(1 2))
- ("Example 3" (#(3 3) 6) #(0 1))))
- (define (test-solution proc)
- (test-begin "Problem 1 Test Suite")
- (for-each (lambda (test-pair)
- (define name (list-ref test-pair 0))
- (define input (list-ref test-pair 1))
- (define output (list-ref test-pair 2))
- (define actual-output (apply proc input))
- (test-equal name output actual-output))
- test-values)
- (test-end))
- (test-solution two-sum)
|