turn off not after application

This commit is contained in:
Damien Elmes 2012-05-23 20:54:03 +09:00
parent 6af7f6e846
commit b63ac7e80d
2 changed files with 2 additions and 0 deletions

View file

@ -107,6 +107,7 @@ class Finder(object):
s['q'] += " and "
if s['isnot']:
s['q'] += " not "
s['isnot'] = False
if wrap:
txt = "(" + txt + ")"
s['q'] += txt

View file

@ -199,6 +199,7 @@ def test_findCards():
# OR searches and nesting
assert len(deck.findCards("tag:monkey or tag:sheep")) == 2
assert len(deck.findCards("(tag:monkey OR tag:sheep)")) == 2
assert len(deck.findCards("-(tag:monkey OR tag:sheep)")) == 6
assert len(deck.findCards("tag:monkey or (tag:sheep sheep)")) == 2
assert len(deck.findCards("tag:monkey or (tag:sheep octopus)")) == 1