UNPKG

647 BJavaScriptView Raw
1var tap = require("tap")
2 , minimatch = require("../")
3
4tap.test("brace expansion", function (t) {
5 // [ pattern, [expanded] ]
6 ; [ [ "a{b,c{d,e},{f,g}h}x{y,z}"
7 , [ "abxy"
8 , "abxz"
9 , "acdxy"
10 , "acdxz"
11 , "acexy"
12 , "acexz"
13 , "afhxy"
14 , "afhxz"
15 , "aghxy"
16 , "aghxz" ] ]
17 , [ "a{1..5}b"
18 , [ "a1b"
19 , "a2b"
20 , "a3b"
21 , "a4b"
22 , "a5b" ] ]
23 , [ "a{b}c", ["a{b}c"] ]
24 ].forEach(function (tc) {
25 var p = tc[0]
26 , expect = tc[1]
27 t.equivalent(minimatch.braceExpand(p), expect, p)
28 })
29 console.error("ending")
30 t.end()
31})
32
33