Clarify Filter tests dealing with bogus operators

(imported from commit db8327eb6df70bc8ffee7fb8166bc6491bd2fe70)
This commit is contained in:
Steve Howell 2013-08-23 13:03:09 -04:00
parent ec5bfa2a10
commit f8c3b70ced

View File

@ -97,10 +97,6 @@ var Filter = require('js/filter.js');
assert(!predicate({stream: 'unsub'}));
assert(predicate({type: 'private'}));
// hack to get line coverage
predicate = get_predicate([['in', 'bogus']]);
predicate({});
predicate = get_predicate([['near', 5]]);
assert(predicate({}));
@ -132,6 +128,19 @@ var Filter = require('js/filter.js');
predicate = get_predicate();
assert(predicate({}));
// Upstream code should prevent Filter.predicate from being called with
// invalid operator/operand combinations, but right now we just silently
// return a function that accepts all messages.
predicate = get_predicate([['in', 'bogus']]);
assert(predicate({}));
predicate = get_predicate([['bogus', 33]]);
assert(predicate({}));
predicate = get_predicate([['is', 'bogus']]);
assert(predicate({}));
}());
(function test_parse_and_unparse() {