[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org 0102988afb 6/7: testing/lisp/test-ob-shell.el: Test
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org 0102988afb 6/7: testing/lisp/test-ob-shell.el: Test async prompt removal |
Date: |
Fri, 29 Mar 2024 09:58:25 -0400 (EDT) |
branch: externals/org
commit 0102988afbcd6694ed26035316449d808873bb42
Author: Matthew Trzcinski <matt@excalamus.com>
Commit: Matthew Trzcinski <matt@excalamus.com>
testing/lisp/test-ob-shell.el: Test async prompt removal
* testing/lisp/test-ob-shell.el (test-ob-shell/session-async-results):
Create test verifying bug report that shell prompt appears in async
results.
---
testing/lisp/test-ob-shell.el | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/testing/lisp/test-ob-shell.el b/testing/lisp/test-ob-shell.el
index 879555af0a..8cebd8467a 100644
--- a/testing/lisp/test-ob-shell.el
+++ b/testing/lisp/test-ob-shell.el
@@ -129,6 +129,30 @@ echo 2<point>
(if (should (string= ": 1\n: 2\n" (buffer-substring-no-properties (point)
(point-max))))
(kill-buffer session-name)))))
+(ert-deftest test-ob-shell/session-async-results ()
+ "Test that async evaluation removes prompt from results."
+ (let* ((session-name "test-ob-shell/session-async-results")
+ (kill-buffer-query-functions nil)
+ (start-time (current-time))
+ (wait-time (time-add start-time 3))
+ uuid-placeholder)
+ (org-test-with-temp-text
+ (concat "#+begin_src sh :session " session-name " :async t
+# print message
+echo \"hello world\"<point>
+#+end_src")
+ (setq uuid-placeholder (org-trim (org-babel-execute-src-block)))
+ (catch 'too-long
+ (while (string-match uuid-placeholder (buffer-string))
+ (progn
+ (sleep-for 0.01)
+ (when (time-less-p wait-time (current-time))
+ (throw 'too-long (ert-fail "Took too long to get result from
callback"))))))
+ (search-forward "#+results")
+ (beginning-of-line 2)
+ (if (should (string= ": hello world\n" (buffer-substring-no-properties
(point) (point-max))))
+ (kill-buffer session-name)))))
+
(ert-deftest test-ob-shell/generic-uses-no-arrays ()
"Test generic serialization of array into a single string."
(org-test-with-temp-text
- [elpa] externals/org updated (1be2f96931 -> e9c288dfac), ELPA Syncer, 2024/03/29
- [elpa] externals/org e9c288dfac 7/7: lisp/ob-comint.el: Fix prompt appearing in async shell results, ELPA Syncer, 2024/03/29
- [elpa] externals/org 227cbb5359 2/7: lisp/ob-comint.el: Create comint prompt filter, ELPA Syncer, 2024/03/29
- [elpa] externals/org c2b763dd14 3/7: testing/lisp/test-ob-comint.el: Make test for echo filter, ELPA Syncer, 2024/03/29
- [elpa] externals/org 574e04d119 5/7: lisp/ob-comint.el: Refactor `org-babel-comint-with-output', ELPA Syncer, 2024/03/29
- [elpa] externals/org 0102988afb 6/7: testing/lisp/test-ob-shell.el: Test async prompt removal,
ELPA Syncer <=
- [elpa] externals/org 820a99b171 1/7: testing/lisp/test-ob-comint.el: Make test for prompt filter, ELPA Syncer, 2024/03/29
- [elpa] externals/org 3776eba2f7 4/7: lisp/ob-comint.el: Create comint echo filter, ELPA Syncer, 2024/03/29