Skip to content

Commit

Permalink
Merge pull request #22 from psibi/test-color
Browse files Browse the repository at this point in the history
Update changelog, add test and bump version
  • Loading branch information
psibi authored Jul 2, 2022
2 parents f9844fa + a8ccfbf commit 3c7f325
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 3 deletions.
4 changes: 4 additions & 0 deletions Changelog.org
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
* 0.9

- Handle carriage return properly on the compilation buffer.

* 0.8

- Define a compilation mode named ~justl-compile-mode~. Executing
Expand Down
2 changes: 1 addition & 1 deletion justl.el
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
;; USA

;; Version: 0.8
;; Version: 0.9
;; Author: Sibi Prabakaran
;; Keywords: just justfile tools processes
;; URL: https://github.com/psibi/justl.el
Expand Down
7 changes: 6 additions & 1 deletion test/justfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,9 @@ carriage-return:
printf "1/3\r"
printf "2/3\r"
printf "3/3\r"
printf "DONE\n"
printf "DONE\n"
# A target that will print colors
color:
#!/usr/bin/env bash
printf "\x1B[31mThis is red text\n"
16 changes: 15 additions & 1 deletion test/justl-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@

(ert-deftest justl--get-recipies-test ()
(should (equal
(list "default" "build-cmd" "plan" "push" "push2" "fail" "carriage-return")
(list "default" "build-cmd" "plan" "push" "push2" "fail" "carriage-return"
"color")
(justl--get-recipies))))

(ert-deftest justl--list-to-recipe-test ()
Expand Down Expand Up @@ -225,6 +226,19 @@
(kill-buffer (justl--buffer-name))
(kill-buffer justl--output-process-buffer))

(ert-deftest justl--execute-recipe-with-color ()
"A target printing color is handled properly."
(justl)
(with-current-buffer (justl--buffer-name)
(search-forward "color")
(justl-exec-recipe)
(justl--wait-till-exit justl--output-process-buffer))
(with-current-buffer justl--output-process-buffer
(let ((buf-string (buffer-substring-no-properties (point-min) (point-max))))
(should (s-contains? "This is red text\n" buf-string))))
(kill-buffer (justl--buffer-name))
(kill-buffer justl--output-process-buffer))

;; (ert "justl--**")

(provide 'justl-test)
Expand Down

0 comments on commit 3c7f325

Please sign in to comment.