mirror of
https://github.com/electron/node-gyp.git
synced 2025-09-16 14:03:39 +02:00
Update bundled node-glob.
This commit is contained in:
parent
a29d3f7d5f
commit
a35dd339c6
28 changed files with 2538 additions and 329 deletions
22
node_modules/glob/test/bash-comparison.js
generated
vendored
22
node_modules/glob/test/bash-comparison.js
generated
vendored
|
@ -5,7 +5,8 @@ var tap = require("tap")
|
|||
|
||||
// put more patterns here.
|
||||
, globs =
|
||||
["test/a/*/+(c|g)/./d"
|
||||
[
|
||||
"test/a/*/+(c|g)/./d"
|
||||
,"test/a/**/[cg]/../[cg]"
|
||||
,"test/a/{b,c,d,e,f}/**/g"
|
||||
,"test/a/b/**"
|
||||
|
@ -64,12 +65,20 @@ globs.forEach(function (pattern) {
|
|||
}).sort(alphasort).reduce(function (set, f) {
|
||||
if (f !== set[set.length - 1]) set.push(f)
|
||||
return set
|
||||
}, [])
|
||||
}, []).sort(alphasort)
|
||||
}
|
||||
next()
|
||||
})
|
||||
|
||||
glob(pattern, function (er, matches) {
|
||||
// sort and unpark, just to match the shell results
|
||||
matches = matches.map(function (m) {
|
||||
return m.replace(/\/+/g, "/").replace(/\/$/, "")
|
||||
}).sort(alphasort).reduce(function (set, f) {
|
||||
if (f !== set[set.length - 1]) set.push(f)
|
||||
return set
|
||||
}, []).sort(alphasort)
|
||||
|
||||
t.ifError(er, pattern + " should not error")
|
||||
globResult = matches
|
||||
next()
|
||||
|
@ -84,7 +93,14 @@ globs.forEach(function (pattern) {
|
|||
})
|
||||
|
||||
tap.test(pattern + " sync", function (t) {
|
||||
t.deepEqual(glob.sync(pattern), echoOutput, "should match shell")
|
||||
var matches = glob.sync(pattern).map(function (m) {
|
||||
return m.replace(/\/+/g, "/").replace(/\/$/, "")
|
||||
}).sort(alphasort).reduce(function (set, f) {
|
||||
if (f !== set[set.length - 1]) set.push(f)
|
||||
return set
|
||||
}, []).sort(alphasort)
|
||||
|
||||
t.deepEqual(matches, echoOutput, "should match shell")
|
||||
t.end()
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue