Browse Source

test inline src blocks

* testing/examples/babel.org (an): Adding example inline code blocks.
* testing/lisp/test-ob.el (test-org-babel/inline-src-blocks): Test
  inline code blocks.
Eric Schulte 13 years ago
parent
commit
14c635450a
2 changed files with 19 additions and 0 deletions
  1. 9 0
      testing/examples/babel.org
  2. 10 0
      testing/lisp/test-ob.el

+ 9 - 0
testing/examples/babel.org

@@ -193,6 +193,15 @@ have quoted results.
 The following 2*5=call_double(5) should export even when prefixed by
 an = sign.
 
+* inline source block
+  :PROPERTIES:
+  :results:  silent
+  :ID:       54cb8dc3-298c-4883-a933-029b3c9d4b18
+  :END:
+Here is one in the middle src_sh{echo 1} of a line.
+Here is one at the end of a line. src_sh{echo 2}
+src_sh{echo 3} Here is one at the beginning of a line.
+
 * parsing header arguments
   :PROPERTIES:
   :ID:       7eb0dc6e-1c53-4275-88b3-b22f3113b9c3

+ 10 - 0
testing/lisp/test-ob.el

@@ -213,6 +213,16 @@
     (org-babel-next-src-block)
     (should (= 14 (org-babel-execute-src-block)))))
 
+(ert-deftest test-org-babel/inline-src-blocks ()
+  (org-test-at-id "54cb8dc3-298c-4883-a933-029b3c9d4b18"
+    (flet ((next ()
+		 (move-end-of-line 1)
+		 (re-search-forward org-babel-inline-src-block-regexp nil t)
+		 (goto-char (match-beginning 1))))
+      (next) (should (equal 1 (org-babel-execute-src-block)))
+      (next) (should (equal 2 (org-babel-execute-src-block)))
+      (next) (should (equal 3 (org-babel-execute-src-block))))))
+
 (provide 'test-ob)
 
 ;;; test-ob ends here