TDDを求めるエンジニアが多いので、gaucheでのユニットテスト例。 ;;テスト対象 (define (proc1 a b c) (if (and (<= a b)(<= a c)) (+ (proc2 b)(proc2 c)) (proc1 b c a))) (define (proc2 x) (* x x)) #| 以下ユニットテスト例。 |# ;;テストモジュールを読み込む (use gauche.test) ;;テストをスタート (test-start "proc1 test") ;;テスト群の名前付け。 (test-section "test group 1") ;;テスト項目 (test* "proc1 13" 13 (proc1 1 2 3)) (test* "proc1 25" 25 (proc1 2 4 3)) (test* "proc1 41" 41 (proc1 5