diff options
author | Aaron Ecay <aaronecay@gmail.com> | 2018-05-10 04:18:04 +0100 |
---|---|---|
committer | Aaron Ecay <aaronecay@gmail.com> | 2018-05-10 04:22:30 +0100 |
commit | d94d52489d9d9939cdbe367e18d08afd7b5f3138 (patch) | |
tree | b2c5a9ab24f70c49660baa774e65a5728209a52f | |
parent | 7fb3328db8688bda7a90bf2121a879e27059f889 (diff) | |
download | org-mode-d94d52489d9d9939cdbe367e18d08afd7b5f3138.tar.gz |
test files: use cl- prefixed functions, and require cl-lib
-rw-r--r-- | testing/lisp/test-ob-lob.el | 4 | ||||
-rw-r--r-- | testing/lisp/test-ob.el | 4 | ||||
-rw-r--r-- | testing/lisp/test-org-agenda.el | 3 | ||||
-rw-r--r-- | testing/lisp/test-org-attach.el | 19 | ||||
-rw-r--r-- | testing/lisp/test-org-element.el | 4 | ||||
-rw-r--r-- | testing/lisp/test-org-timer.el | 6 | ||||
-rw-r--r-- | testing/lisp/test-org.el | 4 |
7 files changed, 28 insertions, 16 deletions
diff --git a/testing/lisp/test-ob-lob.el b/testing/lisp/test-ob-lob.el index 316c53e..4470fef 100644 --- a/testing/lisp/test-ob-lob.el +++ b/testing/lisp/test-ob-lob.el @@ -18,6 +18,8 @@ ;; You should have received a copy of the GNU General Public License ;; along with this program. If not, see <http://www.gnu.org/licenses/>. +(eval-and-compile (require 'cl-lib)) + ;;; Tests (org-babel-lob-ingest @@ -39,7 +41,7 @@ (ert-deftest test-ob-lob/call-with-header-arguments () "Test the evaluation of a library of babel #+call: line." - (letf (((symbol-function 'org-babel-insert-result) + (cl-letf (((symbol-function 'org-babel-insert-result) (symbol-function 'ignore))) (let ((org-babel-library-of-babel (org-test-with-temp-text-in-file diff --git a/testing/lisp/test-ob.el b/testing/lisp/test-ob.el index ff86d5e..af38815 100644 --- a/testing/lisp/test-ob.el +++ b/testing/lisp/test-ob.el @@ -20,6 +20,8 @@ ;;; Code: +(eval-and-compile (require 'cl-lib)) + (ert-deftest test-ob/indented-cached-org-bracket-link () "When the result of a source block is a cached indented link it should still return the link." @@ -553,7 +555,7 @@ on two lines #+NAME: read-literal-example #+BEGIN_SRC emacs-lisp :var x=literal-example - (concatenate 'string x \" for me.\") + (cl-concatenate 'string x \" for me.\") #+END_SRC" (org-babel-next-src-block 1) (should (string= (org-babel-execute-src-block) diff --git a/testing/lisp/test-org-agenda.el b/testing/lisp/test-org-agenda.el index fca8896..552792f 100644 --- a/testing/lisp/test-org-agenda.el +++ b/testing/lisp/test-org-agenda.el @@ -25,6 +25,7 @@ (require 'org-test) (require 'org-agenda) +(eval-and-compile (require 'cl-lib)) ;; General auxilliaries @@ -112,7 +113,7 @@ (org-agenda-list) (let* ((agenda-buffer-name (progn - (assert (= 1 (length (org-test-agenda--agenda-buffers)))) + (cl-assert (= 1 (length (org-test-agenda--agenda-buffers)))) (buffer-name (car (org-test-agenda--agenda-buffers)))))) (set-buffer agenda-buffer-name) (org-agenda-redo) diff --git a/testing/lisp/test-org-attach.el b/testing/lisp/test-org-attach.el index 6d67ec5..bf72028 100644 --- a/testing/lisp/test-org-attach.el +++ b/testing/lisp/test-org-attach.el @@ -26,6 +26,7 @@ (require 'org-test) (require 'org-attach) +(eval-and-compile (require 'cl-lib)) (ert-deftest test-org-attach/dired-attach-to-next-best-subtree/1 () "Attach file at point in dired to subtree." @@ -36,22 +37,22 @@ "* foo :foo:" (split-window) (dired temporary-file-directory) - (assert (eq 'dired-mode major-mode)) + (cl-assert (eq 'dired-mode major-mode)) (revert-buffer) (dired-goto-file a-filename) ; action (call-interactively #'org-attach-dired-to-subtree) ; check (delete-window) - (assert (eq 'org-mode major-mode)) + (cl-assert (eq 'org-mode major-mode)) (beginning-of-buffer) (search-forward "* foo") ; expectation. tag ATTACH has been appended. - (reduce (lambda (x y) (or x y)) - (mapcar (lambda (x) (string-equal "ATTACH" x)) - (plist-get - (plist-get - (org-element-at-point) 'headline) :tags)))) + (cl-reduce (lambda (x y) (or x y)) + (mapcar (lambda (x) (string-equal "ATTACH" x)) + (plist-get + (plist-get + (org-element-at-point) 'headline) :tags)))) (delete-file a-filename))))) (ert-deftest test-org-attach/dired-attach-to-next-best-subtree/2 () @@ -64,7 +65,7 @@ "* foo" (split-window) (dired temporary-file-directory) - (assert (eq 'dired-mode major-mode)) + (cl-assert (eq 'dired-mode major-mode)) (revert-buffer) (dired-goto-file a-filename) (dired-mark 1) @@ -74,7 +75,7 @@ (call-interactively #'org-attach-dired-to-subtree) ; check (delete-window) - (assert (eq 'org-mode major-mode)) + (cl-assert (eq 'org-mode major-mode)) (beginning-of-buffer) (search-forward "* foo") (and (file-exists-p (concat (org-attach-dir) "/" diff --git a/testing/lisp/test-org-element.el b/testing/lisp/test-org-element.el index 1daecb4..d195ba6 100644 --- a/testing/lisp/test-org-element.el +++ b/testing/lisp/test-org-element.el @@ -19,6 +19,8 @@ ;;; Code: +(eval-and-compile (require 'cl-lib)) + (unless (featurep 'org-element) (signal 'missing-test-dependency "org-element")) @@ -46,7 +48,7 @@ Some other text (let ((count 0)) (org-element-map (org-element-parse-buffer) 'plain-text - (lambda (s) (when (string-match "text" s) (incf count)))) + (lambda (s) (when (string-match "text" s) (cl-incf count)))) count)))) ;; Applies to secondary strings (should diff --git a/testing/lisp/test-org-timer.el b/testing/lisp/test-org-timer.el index 9c0aba9..d666210 100644 --- a/testing/lisp/test-org-timer.el +++ b/testing/lisp/test-org-timer.el @@ -21,11 +21,13 @@ ;;; Code: +(eval-and-compile (require 'cl-lib)) + (defmacro test-org-timer/with-temp-text (text &rest body) "Like `org-test-with-temp-text', but set timer-specific variables. Also, mute output from `message'." (declare (indent 1)) - `(letf (((symbol-function 'message) (lambda (&rest args) nil))) + `(cl-letf (((symbol-function 'message) (lambda (&rest args) nil))) (org-test-with-temp-text ,text (let (org-timer-start-time org-timer-pause-time @@ -38,7 +40,7 @@ Also, mute output from `message'." (defmacro test-org-timer/with-current-time (time &rest body) "Run BODY, setting `current-time' output to TIME." (declare (indent 1)) - `(letf (((symbol-function 'current-time) (lambda () ,time))) + `(cl-letf (((symbol-function 'current-time) (lambda () ,time))) ,@body)) diff --git a/testing/lisp/test-org.el b/testing/lisp/test-org.el index 9983106..dc0becb 100644 --- a/testing/lisp/test-org.el +++ b/testing/lisp/test-org.el @@ -22,6 +22,8 @@ ;;; Code: +(eval-and-compile (require 'cl-lib)) + ;;; Comments @@ -7117,7 +7119,7 @@ CLOCK: [2012-03-29 Thu 10:00]--[2012-03-29 Thu 16:40] => 6:40" (let (result (line 0)) (while (not (eobp)) (unless (org-invisible-p2) (push line result)) - (incf line) + (cl-incf line) (forward-line)) (nreverse result)))))) (should (equal '(0 7) (funcall list-visible-lines 'minimal t))) |