Skip to content

Commit

Permalink
Add tests for startIndex and endIndex
Browse files Browse the repository at this point in the history
es128 committed Feb 19, 2014
1 parent 723bfba commit f383323
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/test.coffee
Original file line number Diff line number Diff line change
@@ -72,3 +72,14 @@ describe 'anymatch', ->
]
(expected = do arr.slice).splice arr.indexOf('bar.js'), 1
assert.deepEqual arr.filter(matchFunc), expected

describe 'using matcher subsets', ->
it 'should skip matchers before the startIndex', ->
assert anymatch matchers, 'path/to/file.js', false
assert not anymatch matchers, 'path/to/file.js', false, 1

it 'should skip matchers after and including the endIndex', ->
assert anymatch matchers, 'path/to/bars.js', false
assert not anymatch matchers, 'path/to/bars.js', false, 0, 3
assert not anymatch matchers, 'foo.js', false, 0, 1

0 comments on commit f383323

Please sign in to comment.