Skip to content

Commit

Permalink
Add test for global match. Related to #6.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jake Harding committed Apr 10, 2013
1 parent 36a6f7a commit dd745fe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions test/Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ module.exports = function(grunt) {
, replacement: function(match) { return match.toLowerCase(); }
, path: 'test.txt'
}
, test4: {
pattern: /Y/g
, replacement: 'Z'
, path: 'test.txt'
}
}
});

Expand Down
4 changes: 2 additions & 2 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ var grunt = require('grunt')
, opts = { gruntfile: path.join(testDir, 'Gruntfile.js') }
, tasks = ['sed']
, testFilePath = path.join(testDir, 'test.txt')
, input = ['search', '12-21-2012', 'LOWERCASE'].join('\n')
, output = ['replace', '12-21-endOfWorld', 'lowercase'].join('\n')
, input = ['search', '12-21-2012', 'LOWERCASE', 'YY'].join('\n')
, output = ['replace', '12-21-endOfWorld', 'lowercase', 'ZZ'].join('\n')

fs.writeFileSync(testFilePath, input);

Expand Down

0 comments on commit dd745fe

Please sign in to comment.