From 4cf4291c5b590c45399003a89b4fa29143eecd5a Mon Sep 17 00:00:00 2001 From: Mathieu Lecarme Date: Mon, 5 Dec 2011 21:14:55 +0100 Subject: [PATCH] Testing each filters with multiple values. --- tst/filters/eq.test.js | 11 +++++++++++ tst/filters/ge.test.js | 10 ++++++++++ tst/filters/le.test.js | 11 +++++++++++ 3 files changed, 32 insertions(+) diff --git a/tst/filters/eq.test.js b/tst/filters/eq.test.js index 7d963ed..0da92f9 100644 --- a/tst/filters/eq.test.js +++ b/tst/filters/eq.test.js @@ -57,6 +57,17 @@ test('match true', function(t) { }); +test('match multiple', function(t) { + var f = new EqualityFilter({ + attribute: 'foo', + value: 'bar' + }); + t.ok(f); + t.ok(f.matches({ foo: ['plop', 'bar'] })); + t.end(); +}); + + test('match false', function(t) { var f = new EqualityFilter({ attribute: 'foo', diff --git a/tst/filters/ge.test.js b/tst/filters/ge.test.js index 52b6cb2..604ad14 100644 --- a/tst/filters/ge.test.js +++ b/tst/filters/ge.test.js @@ -57,6 +57,16 @@ test('match true', function(t) { }); +test('match multiple', function(t) { + var f = new GreaterThanEqualsFilter({ + attribute: 'foo', + value: 'bar' + }); + t.ok(f); + t.ok(f.matches({ foo: ['beuha', 'baz'] })); + t.end(); +}); + test('match false', function(t) { var f = new GreaterThanEqualsFilter({ attribute: 'foo', diff --git a/tst/filters/le.test.js b/tst/filters/le.test.js index 21380b4..545cdc3 100644 --- a/tst/filters/le.test.js +++ b/tst/filters/le.test.js @@ -57,6 +57,17 @@ test('match true', function(t) { }); +test('match multiple', function(t) { + var f = new LessThanEqualsFilter({ + attribute: 'foo', + value: 'bar' + }); + t.ok(f); + t.ok(f.matches({ foo: ['abc', 'beuha'] })); + t.end(); +}); + + test('match false', function(t) { var f = new LessThanEqualsFilter({ attribute: 'foo',