From 4db4e411a0b2b4beb10c552dbdee4ec28b1334dc Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Thu, 8 Aug 2019 08:28:40 -0500 Subject: [PATCH] Tests: Fix function definer Works correctly interactively now. --- tests/test-org-ql.el | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tests/test-org-ql.el b/tests/test-org-ql.el index 9acca2d..afd2b02 100644 --- a/tests/test-org-ql.el +++ b/tests/test-org-ql.el @@ -97,12 +97,13 @@ Based on Buttercup macro `it'." (before-all - (defun org-ql-test-org-get-heading () - ;; For Org 9.0.5. - (substring-no-properties (org-get-heading t t))) - (defun org-ql-test-org-get-heading () - ;; For Org 9.1.9. - (substring-no-properties (org-get-heading t t t t))) + (if (version< (org-version) "9.1") + (defun org-ql-test-org-get-heading () + ;; For Org 9.0.5. + (substring-no-properties (org-get-heading t t))) + (defun org-ql-test-org-get-heading () + ;; For Org 9.1.9. + (substring-no-properties (org-get-heading t t t t)))) (setq test-buffer (find-file-noselect (concat default-directory "tests/data.org")) num-headings (with-current-buffer test-buffer