mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
647 B
34 lines
647 B
12 years ago
|
var tap = require("tap")
|
||
|
, minimatch = require("../")
|
||
|
|
||
|
tap.test("brace expansion", function (t) {
|
||
|
// [ pattern, [expanded] ]
|
||
|
; [ [ "a{b,c{d,e},{f,g}h}x{y,z}"
|
||
|
, [ "abxy"
|
||
|
, "abxz"
|
||
|
, "acdxy"
|
||
|
, "acdxz"
|
||
|
, "acexy"
|
||
|
, "acexz"
|
||
|
, "afhxy"
|
||
|
, "afhxz"
|
||
|
, "aghxy"
|
||
|
, "aghxz" ] ]
|
||
|
, [ "a{1..5}b"
|
||
|
, [ "a1b"
|
||
|
, "a2b"
|
||
|
, "a3b"
|
||
|
, "a4b"
|
||
|
, "a5b" ] ]
|
||
|
, [ "a{b}c", ["a{b}c"] ]
|
||
|
].forEach(function (tc) {
|
||
|
var p = tc[0]
|
||
|
, expect = tc[1]
|
||
|
t.equivalent(minimatch.braceExpand(p), expect, p)
|
||
|
})
|
||
|
console.error("ending")
|
||
|
t.end()
|
||
|
})
|
||
|
|
||
|
|