Skip to content

Commit

Permalink
test: clean up case-sensitive drive letter breakage on windows
Browse files Browse the repository at this point in the history
Should fix Appveyor, hopefully
  • Loading branch information
isaacs committed Jun 28, 2016
1 parent 1319866 commit 1728df8
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions test/nocase-nomagic.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ test('nocase, nomagic', function(t) {
throw er
if (process.platform.match(/^win/))
res = res.map(function (r) {
return r.replace(/\\/g, '/').replace(new RegExp('^' + drive + ':'), drive+':')
return r.replace(/\\/g, '/').replace(new RegExp('^' + drive + ':', 'i'), drive+':')
})
t.same(res.sort(), want)
if (--n === 0) t.end()
Expand All @@ -103,7 +103,7 @@ test('nocase, nomagic', function(t) {
throw er
if (process.platform.match(/^win/))
res = res.map(function (r) {
return r.replace(/\\/g, '/').replace(new RegExp('^' + drive + ':'), drive+':')
return r.replace(/\\/g, '/').replace(new RegExp('^' + drive + ':', 'i'), drive+':')
})
t.same(res.sort(), want)
if (--n === 0) t.end()
Expand All @@ -129,15 +129,21 @@ test('nocase, with some magic', function(t) {
glob('/tmp/*', { nocase: true }, function(er, res) {
if (er)
throw er
if (process.platform.match(/^win/))
res = res.map(function (r) { return r.replace(/\\/g, '/') })
if (process.platform.match(/^win/)) {
res = res.map(function (r) {
return r.replace(/\\/g, '/').replace(new RegExp('^' + drive + ':', 'i'), drive+':')
})
}
t.same(res.sort(), want)
})
glob('/tmp/*', { nocase: true }, function(er, res) {
if (er)
throw er
if (process.platform.match(/^win/))
res = res.map(function (r) { return r.replace(/\\/g, '/') })
if (process.platform.match(/^win/)) {
res = res.map(function (r) {
return r.replace(/\\/g, '/').replace(new RegExp('^' + drive + ':', 'i'), drive+':')
})
}
t.same(res.sort(), want)
})
})

0 comments on commit 1728df8

Please sign in to comment.