Skip to content

Commit

Permalink
colorize the result of test
Browse files Browse the repository at this point in the history
* test/run-test.el (twittering-run-test): colorize resulting
outputs
  • Loading branch information
hayamiz committed Dec 27, 2009
1 parent 03a1be7 commit 4342e07
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
@@ -1,3 +1,8 @@
2009-12-27 Yuto Hayamizu <y.hayamizu@gmail.com>

* test/run-test.el (twittering-run-test): colorize resulting
outputs

2009-12-27 Satoshi Yatagawa <yata_github@y.hauN.org>

* twittering-mode.el (twittering-http-post-default-sentinel):
Expand Down
14 changes: 12 additions & 2 deletions test/run-test.el
Expand Up @@ -20,8 +20,18 @@

(test-run-all-cases)

(princ (save-excursion (set-buffer "*test-result*")
(buffer-string)))
(save-excursion
(set-buffer "*test-result*")
(beginning-of-buffer)
(while (search-forward-regexp "\\b[0-9]+ pass\\b" nil t)
(replace-match
(concat "\033[1m\033[32m" (match-string 0) "\033[0m")))

(beginning-of-buffer)
(while (search-forward-regexp "\\b[0-9]+ fail\\b" nil t)
(replace-match
(concat "\033[1m\033[31m" (match-string 0) "\033[0m")))
(princ (buffer-string)))
(terpri))

(twittering-run-test)

0 comments on commit 4342e07

Please sign in to comment.