chibi-test機能追加
実際に使ってみると、機能が足りないことに気づく。
いくつか機能を追加して、いくつかバグを潰した。
些細な変更は省くとして、以下追加した機能
- test以外の比較を追加(test-not test-true test-false)
- 結果表示後、N秒(defaultでは3秒)後に結果表示するバッファを閉じる。
後者は、テスト結果を見てからコーディングへ戻る際に、結果表示するバッファが残ったままだと、存外、ウザいということが分かったので追加した機能。
前者は以下のとおり
(with-chibi-test* (test: "1 is integer" 'integer (type-of 1)) (test-not: "not 1+1 = 10" 10 (+ 1 1)) (test-true: "1 is true" 1) (test-false: "get not exist buffer" (get-buffer "hhhhhhhhhhhhhhhh"))) ;; test: 1 is integer ;; ok! integer ;; test-not: not 1+1 = 10 ;; ok! 2 ;; test-true: 1 is true ;; ok! 1 ;; test-false: get not exist buffer ;; ok! nil ;; ========= short discription =========== ;; Total: 4 OK: 4 NG: 0 ;; =======================================
こんな感じでテストが書けるようになった。