branch: elpa/org-drill
commit 749e012e651e0caa620b13fef861a3c187ac005e
Merge: de1e419ae3 0444db69f5
Author: Phillip Lord <[email protected]>
Commit: Phillip Lord <[email protected]>
Merge branch 'fix/drill-matching' into 'master'
fix reversed member arguments
See merge request phillord/org-drill!2
---
org-drill.el | 2 +-
test/one-two-three.org | 2 +-
test/org-drill-test.el | 18 +++++++++++++-----
3 files changed, 15 insertions(+), 7 deletions(-)
diff --git a/org-drill.el b/org-drill.el
index fcb9e08a97..2f4bc72fc5 100644
--- a/org-drill.el
+++ b/org-drill.el
@@ -724,7 +724,7 @@ CMD is bound, or nil if it is not bound to a key."
(apply 'org-map-entries func
(concat "+" org-drill-question-tag
(if (and (stringp org-drill-match)
- (not (member '(?+ ?- ?|) (elt org-drill-match 0))))
+ (not (member (elt org-drill-match 0) '(?+ ?- ?|))))
"+" "")
(or org-drill-match ""))
(org-drill-current-scope scope)
diff --git a/test/one-two-three.org b/test/one-two-three.org
index a34f905033..c1120b66d9 100644
--- a/test/one-two-three.org
+++ b/test/one-two-three.org
@@ -1,5 +1,5 @@
-* One :drill:
+* One :drill:tagtest:
Body of One
diff --git a/test/org-drill-test.el b/test/org-drill-test.el
index 529d411ea3..eb3c527bae 100644
--- a/test/org-drill-test.el
+++ b/test/org-drill-test.el
@@ -38,8 +38,16 @@
(ert-deftest find-entries ()
(should
- (equal '(2 30 58)
- (assess-with-find-file
- (assess-make-related-file
- (concat this-directory "one-two-three.org"))
- (org-drill-map-entries (lambda () (point)) 'file nil)))))
+ (equal '(2 38 66)
+ (assess-with-find-file
+ (assess-make-related-file
+ (concat this-directory "one-two-three.org"))
+ (org-drill-map-entries (lambda () (point)) 'file nil)))))
+
+(ert-deftest find-tagged-entries ()
+ (should
+ (equal '(2)
+ (assess-with-find-file
+ (assess-make-related-file
+ (concat this-directory "one-two-three.org"))
+ (org-drill-map-entries (lambda () (point)) 'file "tagtest")))))