brace-expand.js 647 B

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