code cleanliness in test-ob.el
authorEric Schulte <schulte.eric@gmail.com>
Fri, 23 Sep 2011 15:50:01 +0000 (09:50 -0600)
committerEric Schulte <schulte.eric@gmail.com>
Fri, 23 Sep 2011 15:50:01 +0000 (09:50 -0600)
* testing/lisp/test-ob.el (test-org-babel/multi-line-header-regexp):
  Code cleanliness.
  (test-org-babel/inline-src_blk-default-results-replace-line-2): Code
  cleanliness.
  (test-org-babel/inline-src_blk-manual-results-replace): Code
  cleanliness.
  (test-org-babel/inline-src_blk-results-silent): Code cleanliness.
  (test-org-babel/inline-src_blk-results-raw): Code cleanliness.
  (test-org-babel/inline-src_blk-results-scalar): Code cleanliness.
  (test-org-babel/inline-src_blk-results-verbatim): Code cleanliness.
  (test-org-babel/no-defaut-value-for-var): Code cleanliness.

testing/lisp/test-ob.el

index 24a64c9..a7ef257 100644 (file)
      "   \t #+headers: blah1 blah2 blah3 \t\n\t\n blah4 blah5 blah6 \n")))
   
   ;;TODO Check - should this fail?
-  (should (not (org-test-string-exact-match
-          org-babel-multi-line-header-regexp
-          "   \t #+headers : blah1 blah2 blah3 \t\n\t\n blah4 blah5 blah6 \n"))))
+  (should
+   (not (org-test-string-exact-match
+        org-babel-multi-line-header-regexp
+        "   \t #+headers : blah1 blah2 blah3 \t\n\t\n blah4 blah5 blah6 \n"))))
 
 (ert-deftest test-org-babel/src-name-w-name-regexp ()
   (should(equal
       (forward-char) (org-ctrl-c-ctrl-c)
       (should (string=
               (concat test-line " =x=")
-              (buffer-substring-no-properties (point-at-bol) (point-at-eol))))))
+              (buffer-substring-no-properties
+               (point-at-bol) (point-at-eol))))))
 
   (let ((test-line "Some text prior to block src_emacs-lisp{ \"y\" }"))
     (org-test-with-temp-text
       (forward-char) (org-ctrl-c-ctrl-c)
       (should (string=
               (concat test-line " =x=")
-              (buffer-substring-no-properties (point-at-bol) (point-at-eol))))))
+              (buffer-substring-no-properties
+               (point-at-bol) (point-at-eol))))))
     
-  (let ((test-line " Some text prior to block src_emacs-lisp[:results replace]{ \"y\" }"))
-    (org-test-with-temp-text
-       test-line
+  (let ((test-line (concat " Some text prior to block "
+                          "src_emacs-lisp[:results replace]{ \"y\" }")))
+    (org-test-with-temp-text test-line
       (goto-char (point-max))
       (insert (concat "\n" test-line " end"))
       (re-search-backward "src") (org-ctrl-c-ctrl-c)
 
 (ert-deftest test-org-babel/inline-src_blk-results-silent ()
   (let ((test-line "src_emacs-lisp[ :results silent ]{ \"x\" }"))
-    (org-test-with-temp-text
-       test-line
+    (org-test-with-temp-text test-line
       (org-ctrl-c-ctrl-c)
       (should (string= test-line
-                      (buffer-substring-no-properties (point-at-bol) (point-at-eol))))
+                      (buffer-substring-no-properties
+                       (point-at-bol) (point-at-eol))))
       (end-of-buffer)
       (should-error (org-ctrl-c-ctrl-c))))
-  (let ((test-line " Some text prior to block src_emacs-lisp[ :results silent ]{ \"y\" }"))
+  (let ((test-line (concat " Some text prior to block src_emacs-lisp"
+                          "[ :results silent ]{ \"y\" }")))
     (org-test-with-temp-text
        test-line
       (goto-char (point-max))
       (insert (concat "\n" test-line " end"))
       (re-search-backward "src_") (org-ctrl-c-ctrl-c)
       (should (string= (concat test-line " end")
-                      (buffer-substring-no-properties (point-at-bol) (point-at-eol))))
+                      (buffer-substring-no-properties
+                       (point-at-bol) (point-at-eol))))
       (re-search-forward "\" ") (org-ctrl-c-ctrl-c)
       (should (string= (concat test-line " end")
-                      (buffer-substring-no-properties (point-at-bol) (point-at-eol))))
+                      (buffer-substring-no-properties
+                       (point-at-bol) (point-at-eol))))
       (forward-char)
       (should-error (org-ctrl-c-ctrl-c)))))
 
 (ert-deftest test-org-babel/inline-src_blk-results-raw ()
   (let ((test-line "src_emacs-lisp[ :results raw ]{ \"x\" }"))
-    (org-test-with-temp-text
-       test-line
+    (org-test-with-temp-text test-line
       (org-ctrl-c-ctrl-c)
       (should (string= (concat test-line " x")
                       (buffer-string)))))
-  (let ((test-line " Some text prior to block src_emacs-lisp[ :results raw ]{ \"the\" }"))
-    (org-test-with-temp-text
-       (concat test-line " end")
+  (let ((test-line (concat " Some text prior to block "
+                          "src_emacs-lisp[ :results raw ]{ \"the\" }")))
+    (org-test-with-temp-text (concat test-line " end")
       (re-search-forward "src_") (org-ctrl-c-ctrl-c)
       (should (string= (concat test-line " the end")
-                      (buffer-substring-no-properties (point-at-bol) (point-at-eol))))
+                      (buffer-substring-no-properties
+                       (point-at-bol) (point-at-eol))))
       (re-search-forward "\" ") (org-ctrl-c-ctrl-c)
       (should (string= (concat test-line " the the end")
-                      (buffer-substring-no-properties (point-at-bol) (point-at-eol))))
+                      (buffer-substring-no-properties
+                       (point-at-bol) (point-at-eol))))
       (forward-char)
       (should-error (org-ctrl-c-ctrl-c)))))
 
        test-line
       (org-ctrl-c-ctrl-c)
       (should (string= (concat test-line " [[file:~/test-file]]")
-                      (buffer-substring-no-properties (point-min) (point-max)))))))
+                      (buffer-substring-no-properties
+                       (point-min) (point-max)))))))
 
 (ert-deftest test-org-babel/inline-src_blk-results-scalar ()
   (let ((test-line "src_emacs-lisp[ :results scalar ]{ \"x\"  }"))
        test-line
       (org-ctrl-c-ctrl-c)
       (should (string= (concat test-line  " =\"x\"=")
-                      (buffer-substring-no-properties (point-min) (point-max)))))))
+                      (buffer-substring-no-properties
+                       (point-min) (point-max)))))))
 
 (ert-deftest test-org-babel/inline-src_blk-results-verbatim ()
   (let ((test-line "src_emacs-lisp[ :results verbatim ]{ \"x\"  }"))
        test-line
       (org-ctrl-c-ctrl-c)
       (should (string= (concat test-line " =\"x\"=")
-                      (buffer-substring-no-properties (point-min) (point-max)))))))
+                      (buffer-substring-no-properties
+                       (point-min) (point-max)))))))
 
 (ert-deftest test-org-babel/combining-scalar-and-raw-result-types ()
   (flet ((next-result ()
     (org-babel-next-src-block)
     (let ((err
           (should-error (org-babel-execute-src-block) :type 'error)))
-      (should (equal '(error "variable \"x\" in block \"carre\" must be assigned a default value") err)))))
+      (should
+       (equal
+       '(error
+         "variable \"x\" in block \"carre\" must be assigned a default value")
+       err)))))
 
 (provide 'test-ob)