From a8ccfbf28b74e4a977dac283c2dcfa7c4c1b578b Mon Sep 17 00:00:00 2001 From: Sibi Prabakaran Date: Sat, 2 Jul 2022 11:24:13 +0530 Subject: [PATCH] Update changelog, add test and bump version --- Changelog.org | 4 ++++ justl.el | 2 +- test/justfile | 7 ++++++- test/justl-test.el | 16 +++++++++++++++- 4 files changed, 26 insertions(+), 3 deletions(-) diff --git a/Changelog.org b/Changelog.org index 1165f17..9cdb051 100644 --- a/Changelog.org +++ b/Changelog.org @@ -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 diff --git a/justl.el b/justl.el index 21fa4b9..5b8679a 100644 --- a/justl.el +++ b/justl.el @@ -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 diff --git a/test/justfile b/test/justfile index 0f05dc5..d61c91a 100644 --- a/test/justfile +++ b/test/justfile @@ -28,4 +28,9 @@ carriage-return: printf "1/3\r" printf "2/3\r" printf "3/3\r" - printf "DONE\n" \ No newline at end of file + printf "DONE\n" + +# A target that will print colors +color: + #!/usr/bin/env bash + printf "\x1B[31mThis is red text\n" diff --git a/test/justl-test.el b/test/justl-test.el index cf5555c..d8e20c9 100644 --- a/test/justl-test.el +++ b/test/justl-test.el @@ -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 () @@ -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)