aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremie Juste2022-12-03 21:02:25 +0100
committerJeremie Juste2022-12-03 22:58:19 +0100
commitffb30cd7373a59e484bfa78c773ea1f46e7fbb41 (patch)
tree2d8adb5d995a3e1823a506d9e7cc36c35b88d241
parent53814a8068489eb7baa8ff408b4da15ae6699beb (diff)
downloademacs-main.tar.gz
emacs-main.zip
test-ob-R.el: Add tests for :results outputmain
* test-ob-R.el (ob-session-R-results-output, ob-session-R-results-output-no-drawer): Two new functions to test that :results works as expected with and without drawers. This commit is to ensure that the bug reported in https://list.orgmode.org/87h6yel4vr.fsf@localhost/, does not happen again.
-rw-r--r--testing/lisp/test-ob-R.el33
1 files changed, 33 insertions, 0 deletions
diff --git a/testing/lisp/test-ob-R.el b/testing/lisp/test-ob-R.el
index f6143b994bf..b4a927f3972 100644
--- a/testing/lisp/test-ob-R.el
+++ b/testing/lisp/test-ob-R.el
@@ -248,6 +248,39 @@ log10(10)
248 248
249 249
250 250
251;; add test for results output
252(ert-deftest ob-session-R-results-output ()
253 (let (ess-ask-for-ess-directory
254 ess-history-file
255 org-confirm-babel-evaluate
256 (org-babel-temporary-directory "/tmp")
257 (src-block "#+begin_src R :session R :results output drawer\n 1:5\n#+end_src")
258 (result "\n\n#+RESULTS:\n:results:\n[1] 1 2 3 4 5\n:end:\n"))
259 (org-test-with-temp-text
260 src-block
261 (should (progn (org-babel-execute-src-block)
262 (sleep-for 0 200)
263 (string= (concat src-block result)
264 (buffer-string)))))))
265
266
267;; add test for result without drawer
268(ert-deftest ob-session-R-results-output-no-drawer ()
269 (let (ess-ask-for-ess-directory
270 ess-history-file
271 org-confirm-babel-evaluate
272 (org-babel-temporary-directory "/tmp")
273 (src-block "#+begin_src R :session R :results output \n 1:5\n#+end_src")
274 (result "\n\n#+RESULTS:\n: [1] 1 2 3 4 5\n"))
275 (org-test-with-temp-text
276 src-block
277 (should (progn (org-babel-execute-src-block)
278 (sleep-for 0 200)
279 (string= (concat src-block result)
280 (buffer-string)))))))
281
282
283
251 284
252(provide 'test-ob-R) 285(provide 'test-ob-R)
253 286