I'm try to write a test for following src block: #+begin_src sh :results link :file "test.txt" echo "hello" > test.txt echo "test" #+end_src #+RESULTS[<2018-04-08 18:30:51> 22a787defa349526768722f4bfc8509dd16ab154]: [[file:test.txt]] And here is my ert test: (ert-deftest test-ob/result-file-link-type-header-argument () "Ensure that the result is a link to a file. The file is just a link to :file value. Inhibit non-empty result write to :file." (org-test-with-temp-text " #+begin_src sh :results link :file \"/tmp/test.txt\" echo \"hello\" > /tmp/test.txt echo \"test\" #+end_src" (org-babel-next-src-block 1) (org-babel-execute-src-block) (goto-char (point-min)) (should (search-forward "[[file:test.txt]]" nil nil)) (should (with-temp-buffer (insert-file-contents "/tmp/test.txt") (string= "hello\n" (buffer-substring-no-properties (point-min) (point-max))))) )) I run test with async shell command in Emacs: make BTEST_RE="test-ob/result-file-link-type-header-argument" test-dirty But I got error: ``` selected tests: test-ob/result-file-link-type-header-argument Running 1 tests (2018-04-08 20:52:41+0800, selector ‘"test-ob/result-file-link-type-header-argument"’) executing Sh code block... Code block evaluation complete. Test test-ob/result-file-link-type-header-argument backtrace: search-forward("[[file:test.txt]]" nil nil nil) apply(search-forward ("[[file:test.txt]]" nil nil)) (setq value-1950 (apply fn-1948 args-1949)) (unwind-protect (setq value-1950 (apply fn-1948 args-1949)) (setq fo (if (unwind-protect (setq value-1950 (apply fn-1948 args-1949)) (set (let (form-description-1952) (if (unwind-protect (setq value-1950 (a (let ((value-1950 'ert-form-evaluation-aborted-1951)) (let (form-des (let* ((fn-1948 (function search-forward)) (args-1949 (condition-cas (progn (org-mode) (let ((point (string-match "" inside-text)) (unwind-protect (progn (org-mode) (let ((point (string-match "