aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhillip Lord <phillip.lord@newcastle.ac.uk>2019-07-21 20:09:42 +0000
committerPhillip Lord <phillip.lord@newcastle.ac.uk>2019-07-21 20:09:42 +0000
commit883fbfcfe2f6a1a850faa9f366746ba88f7ac6c1 (patch)
treefae231c879b5f5a375e9cfbf90feaeb1377727c4
parentde1e419ae39fa7b1f315ad00cb2671bd976c5d6d (diff)
parent0444db69f55c302a6ac0d6ee5c8558ede4d3d09a (diff)
downloadorg-drill-883fbfcfe2f6a1a850faa9f366746ba88f7ac6c1.tar.gz
org-drill-883fbfcfe2f6a1a850faa9f366746ba88f7ac6c1.zip
Merge branch 'fix/drill-matching' into 'master'
fix reversed member arguments See merge request phillord/org-drill!2
-rw-r--r--org-drill.el2
-rw-r--r--test/one-two-three.org2
-rw-r--r--test/org-drill-test.el18
3 files changed, 15 insertions, 7 deletions
diff --git a/org-drill.el b/org-drill.el
index fcb9e08..2f4bc72 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 a34f905..c1120b6 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 529d411..eb3c527 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")))))