testing/lisp/test-ob-comint.el: Make test for echo filter

* test-ob-comint.el:
(test-org-babel-comint/echo-filter-removes-echo): Test that echoed
input is removed from process buffer output.
This commit is contained in:
Matthew Trzcinski 2024-03-17 16:56:43 +01:00
parent 227cbb5359
commit c2b763dd14
1 changed files with 20 additions and 0 deletions

View File

@ -49,6 +49,26 @@ ob_comint_async_shell_start_d78ac49f-dc8a-4c39-827c-c93225484d59
\"hello world\"
ob_comint_async_shell_end_d78ac49f-dc8a-4c39-827c-c93225484d59"))))
(ert-deftest test-org-babel-comint/echo-filter-removes-echo ()
"Test that echo is actually removed."
(let* ((echo "echo 'ob_comint_async_shell_start_d78ac49f-dc8a-4c39-827c-c93225484d59'
# print message
echo \"hello world\"
echo 'ob_comint_async_shell_end_d78ac49f-dc8a-4c39-827c-c93225484d59'")
(result "org_babel_sh_prompt> echo 'ob_comint_async_shell_start_d78ac49f-dc8a-4c39-827c-c93225484d59'
# print message
echo \"hello world\"
echo 'ob_comint_async_shell_end_d78ac49f-dc8a-4c39-827c-c93225484d59'
ob_comint_async_shell_start_d78ac49f-dc8a-4c39-827c-c93225484d59
org_babel_sh_prompt> org_babel_sh_prompt> \"hello world\"
org_babel_sh_prompt> ob_comint_async_shell_end_d78ac49f-dc8a-4c39-827c-c93225484d59
org_babel_sh_prompt> "))
(should (string=
(org-babel-comint--echo-filter result echo)
"\nob_comint_async_shell_start_d78ac49f-dc8a-4c39-827c-c93225484d59
org_babel_sh_prompt> org_babel_sh_prompt> \"hello world\"
org_babel_sh_prompt> ob_comint_async_shell_end_d78ac49f-dc8a-4c39-827c-c93225484d59
org_babel_sh_prompt> "))))
(provide 'test-ob-comint)