ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
[TOC] ## 测试原则 当需要对值进行比较时,使用`equa?`进行测试。 ## 实例 ``` (define (add x y) (+ x y)) (define (test-add func-res hope-res) (cond [(equal? hope-res func-res) true] [else (error 'test-add "run is error func result is " func-res " expected is " hope-res)])) (test-add (add 1 2) 3) ;#true (test-add (add 1 2) 4) ;test-add: run is error func result is 3 expected is 4 ``` equal? 可以对任何类型类型进行比较