Skip to content
This repository has been archived by the owner on May 7, 2022. It is now read-only.

Commit

Permalink
update: 添加正则testcase
Browse files Browse the repository at this point in the history
  • Loading branch information
xuexb committed Apr 29, 2016
1 parent 7885a6d commit 2e1e5c0
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,24 @@ describe('fs-grep', () => {
});
});

it('exec(reg, dir)', done => {
mock({
'test/test.md': 'xxno',
'test/test2.md': 'nox',
'test/test3.md': 'md'
});

let read = exec(/^no(.+?)/, './test/**/*');

read.on('end', data => {
data.length.should.equal(1);
data[0].data.length.should.equal(1);
data[0].data[0].index.should.equal(1);
data[0].data[0].content.should.equal('nox');
done();
});
});

it('exec empty path', done => {
let read = exec('xieJifksljfds', './empty/**/*');
read.on('end', data => {
Expand Down

0 comments on commit 2e1e5c0

Please sign in to comment.