Skip to content

Commit

Permalink
Modified to use new matchme operators
Browse files Browse the repository at this point in the history
  • Loading branch information
DamonOehlman committed May 31, 2014
1 parent 9e8ae67 commit 9ef42e4
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions test/filtered.js
Expand Up @@ -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++;
})
Expand All @@ -35,4 +51,4 @@ test('filter on numeric properties', function(t) {
.on('end', function() {
t.equal(count, 103, 'ok');
});
});
});

0 comments on commit 9ef42e4

Please sign in to comment.