From 9ef42e42aceff6ad53dc8ebb20819451b1acdf07 Mon Sep 17 00:00:00 2001 From: Damon Oehlman Date: Sat, 31 May 2014 18:28:43 +1000 Subject: [PATCH] Modified to use new matchme operators --- test/filtered.js | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/test/filtered.js b/test/filtered.js index 62ed7df..c301c84 100644 --- a/test/filtered.js +++ b/test/filtered.js @@ -9,10 +9,26 @@ test('filter on a string property', function(t) { var count = 0; t.plan(1); - + + fs.createReadStream(datapath) + .pipe(csv({ json: true })) + .pipe(filterstream('Suburb =~ "Ferny Grove"')) + .on('data', function(item) { + count++; + }) + .on('end', function() { + t.equal(count, 19, 'ok'); + }); +}); + +test('filter on a string property (case sensitive matching)', function(t) { + var count = 0; + + t.plan(1); + fs.createReadStream(datapath) .pipe(csv({ json: true })) - .pipe(filterstream('Suburb == "Ferny Grove"')) + .pipe(filterstream('Suburb == "FERNY GROVE"')) .on('data', function(item) { count++; }) @@ -35,4 +51,4 @@ test('filter on numeric properties', function(t) { .on('end', function() { t.equal(count, 103, 'ok'); }); -}); \ No newline at end of file +});