2014-01-29 48 views
0

我必須爲Scheme中的每個函數創建測試用例。我收到一個錯誤:check-equal?:bad syntax 我在做什麼錯? 這是我有:計劃球拍Rackunit

(require rackunit) 

;Zip takes two lists and pairs each of the nth 
;elements together 
(define (zip . xss) 
    (apply map list xss) 
) 

(define (zip-test2) 
    (check-eq? (zip '(a b c) '(1 2 3))) 
) 

回答

2

check-equal?check-eq?都需要至少2個參數:表達檢查和預期值[1]。你似乎只提供一個表達來檢查,沒有預期的價值。想必你想是這樣的:

(check-equal? (zip '(a b c) '(1 2 3)) 
       '((a 1) (b 2) (c 3))) 

更多信息可在文檔中:

[1] http://doc.racket-lang.org/rackunit/api.html