mirror of
https://github.com/ankitects/anki.git
synced 2025-11-09 14:17:13 -05:00
allow != in properties
This commit is contained in:
parent
b63ac7e80d
commit
942beef5de
2 changed files with 2 additions and 1 deletions
|
|
@ -256,7 +256,7 @@ class Finder(object):
|
||||||
|
|
||||||
def _findProp(self, val):
|
def _findProp(self, val):
|
||||||
# extract
|
# extract
|
||||||
m = re.match("(^.+?)(<=|>=|=|<|>)(.+?$)", val)
|
m = re.match("(^.+?)(<=|>=|!=|=|<|>)(.+?$)", val)
|
||||||
if not m:
|
if not m:
|
||||||
return
|
return
|
||||||
prop, cmp, val = m.groups()
|
prop, cmp, val = m.groups()
|
||||||
|
|
|
||||||
|
|
@ -161,6 +161,7 @@ def test_findCards():
|
||||||
assert len(deck.findCards("prop:ivl>=5")) == 1
|
assert len(deck.findCards("prop:ivl>=5")) == 1
|
||||||
assert len(deck.findCards("prop:ivl=9")) == 0
|
assert len(deck.findCards("prop:ivl=9")) == 0
|
||||||
assert len(deck.findCards("prop:ivl=10")) == 1
|
assert len(deck.findCards("prop:ivl=10")) == 1
|
||||||
|
assert len(deck.findCards("prop:ivl!=10")) > 1
|
||||||
assert len(deck.findCards("prop:due>0")) == 1
|
assert len(deck.findCards("prop:due>0")) == 1
|
||||||
# due dates should work
|
# due dates should work
|
||||||
deck.sched.today = 15
|
deck.sched.today = 15
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue