Skip to content

Commit

Permalink
Generate fixtures more effectively, with -O instead of eval
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Jul 5, 2015
1 parent f96190b commit 0a2b519
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
1 change: 0 additions & 1 deletion .gitignore
@@ -1,5 +1,4 @@
.*.swp
test/a/
node_modules/*
v8.log
profile.txt
Expand Down
14 changes: 8 additions & 6 deletions test/00-setup.js
Expand Up @@ -107,12 +107,14 @@ var fs = require("fs")

globs.forEach(function (pattern) {
tap.test("generate fixture " + pattern, function (t) {
var cmd = "shopt -s globstar && " +
"shopt -s extglob && " +
"shopt -s nullglob && " +
// "shopt >&2; " +
"eval \'for i in " + pattern + "; do echo $i; done\'"
var cp = spawn("bash", ["-c", cmd], { cwd: fixtureDir })
var opts = [
"-O", "globstar",
"-O", "extglob",
"-O", "nullglob",
"-c",
"for i in " + pattern + "; do echo $i; done"
]
var cp = spawn("bash", opts, { cwd: fixtureDir })
var out = []
cp.stdout.on("data", function (c) {
out.push(c)
Expand Down

0 comments on commit 0a2b519

Please sign in to comment.