From 638ae6c18f22546ebc441a7f8cb87797300f5a06 Mon Sep 17 00:00:00 2001 From: Sibi Prabakaran Date: Sun, 8 Dec 2024 19:18:01 +0530 Subject: [PATCH] Fix tests --- test/justl-test.el | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/test/justl-test.el b/test/justl-test.el index 382b01f..ef68452 100644 --- a/test/justl-test.el +++ b/test/justl-test.el @@ -34,10 +34,10 @@ (ert-deftest justl--lists-recipe () (justl) - (with-current-buffer (justl--buffer-name) + (with-current-buffer (justl--buffer-name nil) (let ((buf-string (buffer-string))) (should (search-forward "plan" nil t)))) - (kill-buffer (justl--buffer-name))) + (kill-buffer (justl--buffer-name nil))) (defun justl--wait-till-exit (buffer) "Wait till the BUFFER has exited." @@ -47,38 +47,38 @@ (ert-deftest justl--execute-recipe () (justl) - (with-current-buffer (justl--buffer-name) + (with-current-buffer (justl--buffer-name nil) (search-forward "plan") (justl-exec-recipe) (justl--wait-till-exit (justl--recipe-output-buffer "plan"))) (with-current-buffer (justl--recipe-output-buffer "plan") (let ((buf-string (buffer-substring-no-properties (point-min) (point-max)))) (should (s-contains? "planner" buf-string)))) - (kill-buffer (justl--buffer-name)) + (kill-buffer (justl--buffer-name nil)) (kill-buffer (justl--recipe-output-buffer "plan"))) (ert-deftest justl--execute-test-exit-status () (justl) - (with-current-buffer (justl--buffer-name) + (with-current-buffer (justl--buffer-name nil) (search-forward "plan") (justl-exec-recipe) (justl--wait-till-exit (justl--recipe-output-buffer "plan"))) (with-current-buffer (justl--recipe-output-buffer "plan") (let ((buf-string (buffer-substring-no-properties (point-min) (point-max)))) (should (s-contains? "Target execution finished" buf-string)))) - (kill-buffer (justl--buffer-name)) + (kill-buffer (justl--buffer-name nil)) (kill-buffer (justl--recipe-output-buffer "plan"))) (ert-deftest justl--fail-recipe () (justl) - (with-current-buffer (justl--buffer-name) + (with-current-buffer (justl--buffer-name nil) (search-forward "fail") (justl-exec-recipe) (justl--wait-till-exit (justl--recipe-output-buffer "fail")) (with-current-buffer (justl--recipe-output-buffer "fail") (let ((buf-string (buffer-substring-no-properties (point-min) (point-max)))) (should (s-contains? "exited abnormally" buf-string)))) - (kill-buffer (justl--buffer-name)) + (kill-buffer (justl--buffer-name nil)) (kill-buffer (justl--recipe-output-buffer "fail")))) (ert-deftest justl--find-justfile-check () @@ -87,7 +87,7 @@ (ert-deftest justl--execute-recipe-which-prints-carriage-return () "Carriage return should be handled in a way that allows overwriting lines." (justl) - (with-current-buffer (justl--buffer-name) + (with-current-buffer (justl--buffer-name nil) (search-forward "carriage-return") (justl-exec-recipe) (justl--wait-till-exit (justl--recipe-output-buffer "carriage-return"))) @@ -95,20 +95,20 @@ (let ((buf-string (buffer-substring-no-properties (point-min) (point-max)))) (should (s-contains? "DONE\n" buf-string)) (should-not (s-contains? "1/3\r2/3\r3/3\rDONE\n" buf-string)))) - (kill-buffer (justl--buffer-name)) + (kill-buffer (justl--buffer-name nil)) (kill-buffer (justl--recipe-output-buffer "carriage-return"))) (ert-deftest justl--execute-recipe-with-color () "A target printing color is handled properly." (justl) - (with-current-buffer (justl--buffer-name) + (with-current-buffer (justl--buffer-name nil) (search-forward "color") (justl-exec-recipe) (justl--wait-till-exit (justl--recipe-output-buffer "color"))) (with-current-buffer (justl--recipe-output-buffer "color") (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--buffer-name nil)) (kill-buffer (justl--recipe-output-buffer "color"))) (ert-deftest justl--execute-default-recipe () @@ -152,27 +152,27 @@ (let ((current justl-per-recipe-buffer)) (customize-set-variable 'justl-per-recipe-buffer 't) (justl) - (with-current-buffer (justl--buffer-name) + (with-current-buffer (justl--buffer-name nil) (search-forward "plan") (justl-exec-recipe) (justl--wait-till-exit "*just-plan*")) (with-current-buffer "*just-plan*" (let ((buf-string (buffer-substring-no-properties (point-min) (point-max)))) (should (s-contains? "Target execution finished" buf-string)))) - (kill-buffer (justl--buffer-name)) + (kill-buffer (justl--buffer-name nil)) (kill-buffer "*just-plan*") (customize-set-variable 'justl-per-recipe-buffer current))) (ert-deftest justl--no-private-recipe-by-default () (justl) - (with-current-buffer (justl--buffer-name) + (with-current-buffer (justl--buffer-name nil) (let ((buf-string (buffer-substring-no-properties (point-min) (point-max)))) (should-not (s-contains? "_private" buf-string))))) (ert-deftest justl--private-recipe-visible () (let ((justl-include-private-recipes t)) (justl)) - (with-current-buffer (justl--buffer-name) + (with-current-buffer (justl--buffer-name nil) (let ((buf-string (buffer-substring-no-properties (point-min) (point-max)))) (should (s-contains? "_private" buf-string)))))