|
@@ -275,14 +275,14 @@ this is simple"
|
|
|
(should (fboundp 'org-babel-get-inline-src-block-matches))
|
|
|
(should (re-search-forward "src_" nil t)) ;; 1
|
|
|
(should (org-babel-get-inline-src-block-matches))
|
|
|
- (should (re-search-forward "}" nil (point-at-bol))) ;; 1
|
|
|
+ (should (re-search-forward " b" nil (point-at-bol))) ;; 1
|
|
|
(should-not (org-babel-get-inline-src-block-matches))
|
|
|
(should (re-search-forward "in" nil t)) ;; 2
|
|
|
(should-not (org-babel-get-inline-src-block-matches))
|
|
|
(should (re-search-forward "echo" nil t)) ;; 2
|
|
|
(should (org-babel-get-inline-src-block-matches))
|
|
|
(should (re-search-forward "blocks" nil t)) ;; 3
|
|
|
- (backward-char 8) ;; 3
|
|
|
+ (backward-char 7) ;; 3
|
|
|
(should (org-babel-get-inline-src-block-matches))
|
|
|
(forward-char 1) ;;3
|
|
|
(should-not (org-babel-get-inline-src-block-matches))
|
|
@@ -301,18 +301,18 @@ this is simple"
|
|
|
test-line
|
|
|
(goto-char (point-min)) (org-ctrl-c-ctrl-c)
|
|
|
(should (string=
|
|
|
- (concat test-line " =1=")
|
|
|
+ (concat test-line " {{{results(=1=)}}}")
|
|
|
(buffer-substring-no-properties (point-at-bol) (point-at-eol))))
|
|
|
(forward-char) (org-ctrl-c-ctrl-c)
|
|
|
(should (string=
|
|
|
- (concat test-line " =1= =1=")
|
|
|
+ (concat test-line " {{{results(=1=)}}}")
|
|
|
(buffer-substring-no-properties (point-at-bol) (point-at-eol))))
|
|
|
- (re-search-forward "1}")
|
|
|
- (should-error (org-ctrl-c-ctrl-c))
|
|
|
- (backward-char) ;; last char of block body
|
|
|
+ (re-search-forward "{{{")
|
|
|
+ ;;(should-error (org-ctrl-c-ctrl-c))
|
|
|
+ (backward-char 4) ;; last char of block body
|
|
|
(org-ctrl-c-ctrl-c)
|
|
|
(should (string=
|
|
|
- (concat test-line " =1= =1= =1=")
|
|
|
+ (concat test-line " {{{results(=1=)}}}")
|
|
|
(buffer-substring-no-properties (point-at-bol) (point-at-eol)))))
|
|
|
;; src_ follows space line 1...
|
|
|
(let ((test-line " src_emacs-lisp{ 1 }"))
|
|
@@ -321,14 +321,15 @@ this is simple"
|
|
|
(should-error (org-ctrl-c-ctrl-c))
|
|
|
(forward-char) (org-ctrl-c-ctrl-c)
|
|
|
(should (string=
|
|
|
- (concat test-line " =1=")
|
|
|
+ (concat test-line " {{{results(=1=)}}}")
|
|
|
(buffer-substring-no-properties (point-at-bol) (point-at-eol))))
|
|
|
(re-search-forward "{ 1 ") (org-ctrl-c-ctrl-c)
|
|
|
(should (string=
|
|
|
- (concat test-line " =1= =1=")
|
|
|
+ (concat test-line " {{{results(=1=)}}}")
|
|
|
(buffer-substring-no-properties (point-at-bol) (point-at-eol))))
|
|
|
- (forward-char)
|
|
|
- (should-error (org-ctrl-c-ctrl-c))))))
|
|
|
+ (forward-char 6)
|
|
|
+ (should-error (org-ctrl-c-ctrl-c))
|
|
|
+ ))))
|
|
|
|
|
|
(ert-deftest test-org-babel/inline-src_blk-default-results-replace-line-2 ()
|
|
|
;; src_ at bol line 2...
|
|
@@ -343,10 +344,9 @@ this is simple"
|
|
|
(should-error (org-ctrl-c-ctrl-c))
|
|
|
(forward-char) (org-ctrl-c-ctrl-c)
|
|
|
(should (string=
|
|
|
- (concat test-line " =x=")
|
|
|
+ (concat test-line " {{{results(=x=)}}}")
|
|
|
(buffer-substring-no-properties
|
|
|
(point-at-bol) (point-at-eol))))))
|
|
|
-
|
|
|
(let ((test-line "Some text prior to block src_emacs-lisp{ \"y\" }")
|
|
|
(org-babel-inline-result-wrap "=%s="))
|
|
|
(org-test-with-temp-text
|
|
@@ -355,13 +355,13 @@ this is simple"
|
|
|
(insert (concat "\n" test-line " end"))
|
|
|
(re-search-backward "src") (org-ctrl-c-ctrl-c)
|
|
|
(should (string=
|
|
|
- (concat test-line " =y= end")
|
|
|
+ (concat test-line " {{{results(=y=)}}} end")
|
|
|
(buffer-substring-no-properties (point-at-bol) (point-at-eol))))
|
|
|
(re-search-forward "\" ") (org-ctrl-c-ctrl-c)
|
|
|
(should (string=
|
|
|
- (concat test-line " =y= =y= end")
|
|
|
+ (concat test-line " {{{results(=y=)}}} end")
|
|
|
(buffer-substring-no-properties (point-at-bol) (point-at-eol))))
|
|
|
- (forward-char)
|
|
|
+ (forward-char 3)
|
|
|
(should-error (org-ctrl-c-ctrl-c)))))
|
|
|
|
|
|
(ert-deftest test-org-babel/inline-src_blk-manual-results-replace ()
|
|
@@ -371,15 +371,14 @@ this is simple"
|
|
|
(concat "\n" test-line)
|
|
|
(should-error (org-ctrl-c-ctrl-c))
|
|
|
(goto-char (point-max))
|
|
|
- (should-error (org-ctrl-c-ctrl-c))
|
|
|
+ (org-ctrl-c-ctrl-c)
|
|
|
(beginning-of-line)
|
|
|
(should-error (org-ctrl-c-ctrl-c))
|
|
|
(forward-char) (org-ctrl-c-ctrl-c)
|
|
|
(should (string=
|
|
|
- (concat test-line " =x=")
|
|
|
+ (concat test-line " {{{results(=x=)}}}")
|
|
|
(buffer-substring-no-properties
|
|
|
(point-at-bol) (point-at-eol))))))
|
|
|
-
|
|
|
(let ((test-line (concat " Some text prior to block "
|
|
|
"src_emacs-lisp[:results replace]{ \"y\" }"))
|
|
|
(org-babel-inline-result-wrap "=%s="))
|
|
@@ -388,13 +387,13 @@ this is simple"
|
|
|
(insert (concat "\n" test-line " end"))
|
|
|
(re-search-backward "src") (org-ctrl-c-ctrl-c)
|
|
|
(should (string=
|
|
|
- (concat test-line " =y= end")
|
|
|
+ (concat test-line " {{{results(=y=)}}} end")
|
|
|
(buffer-substring-no-properties (point-at-bol) (point-at-eol))))
|
|
|
(re-search-forward "\" ") (org-ctrl-c-ctrl-c)
|
|
|
(should (string=
|
|
|
- (concat test-line " =y= =y= end")
|
|
|
+ (concat test-line " {{{results(=y=)}}} end")
|
|
|
(buffer-substring-no-properties (point-at-bol) (point-at-eol))))
|
|
|
- (forward-char)
|
|
|
+ (forward-char 3)
|
|
|
(should-error (org-ctrl-c-ctrl-c)))))
|
|
|
|
|
|
(ert-deftest test-org-babel/inline-src_blk-results-silent ()
|
|
@@ -403,9 +402,7 @@ this is simple"
|
|
|
(org-ctrl-c-ctrl-c)
|
|
|
(should (string= test-line
|
|
|
(buffer-substring-no-properties
|
|
|
- (point-at-bol) (point-at-eol))))
|
|
|
- (end-of-buffer)
|
|
|
- (should-error (org-ctrl-c-ctrl-c))))
|
|
|
+ (point-at-bol) (point-at-eol))))))
|
|
|
(let ((test-line (concat " Some text prior to block src_emacs-lisp"
|
|
|
"[ :results silent ]{ \"y\" }")))
|
|
|
(org-test-with-temp-text
|
|
@@ -420,7 +417,7 @@ this is simple"
|
|
|
(should (string= (concat test-line " end")
|
|
|
(buffer-substring-no-properties
|
|
|
(point-at-bol) (point-at-eol))))
|
|
|
- (forward-char)
|
|
|
+ (forward-char 2)
|
|
|
(should-error (org-ctrl-c-ctrl-c)))))
|
|
|
|
|
|
(ert-deftest test-org-babel/inline-src_blk-results-raw ()
|
|
@@ -440,7 +437,7 @@ this is simple"
|
|
|
(should (string= (concat test-line " the the end")
|
|
|
(buffer-substring-no-properties
|
|
|
(point-at-bol) (point-at-eol))))
|
|
|
- (forward-char)
|
|
|
+ (forward-char 2)
|
|
|
(should-error (org-ctrl-c-ctrl-c)))))
|
|
|
|
|
|
(ert-deftest test-org-babel/inline-src_blk-results-file ()
|
|
@@ -448,7 +445,7 @@ this is simple"
|
|
|
(org-test-with-temp-text
|
|
|
test-line
|
|
|
(org-ctrl-c-ctrl-c)
|
|
|
- (should (string= (concat test-line " [[file:~/test-file]]")
|
|
|
+ (should (string= (concat test-line " {{{results([[file:~/test-file]])}}}")
|
|
|
(buffer-substring-no-properties
|
|
|
(point-min) (point-max)))))))
|
|
|
|
|
@@ -458,7 +455,7 @@ this is simple"
|
|
|
(org-test-with-temp-text
|
|
|
test-line
|
|
|
(org-ctrl-c-ctrl-c)
|
|
|
- (should (string= (concat test-line " =\"x\"=")
|
|
|
+ (should (string= (concat test-line " {{{results(=\"x\"=)}}}")
|
|
|
(buffer-substring-no-properties
|
|
|
(point-min) (point-max)))))))
|
|
|
|
|
@@ -468,7 +465,7 @@ this is simple"
|
|
|
(org-test-with-temp-text
|
|
|
test-line
|
|
|
(org-ctrl-c-ctrl-c)
|
|
|
- (should (string= (concat test-line " =\"x\"=")
|
|
|
+ (should (string= (concat test-line " {{{results(=\"x\"=)}}}")
|
|
|
(buffer-substring-no-properties
|
|
|
(point-min) (point-max)))))))
|
|
|
|