Browse Source

Decoupled readdir test.

v0.7.4-release
arlolra 15 years ago
committed by Ryan Dahl
parent
commit
3497da370b
  1. 0
      test/fixtures/readdir/are
  2. 0
      test/fixtures/readdir/dir/empty
  3. 0
      test/fixtures/readdir/empty
  4. 0
      test/fixtures/readdir/files
  5. 0
      test/fixtures/readdir/for
  6. 0
      test/fixtures/readdir/just
  7. 0
      test/fixtures/readdir/testing.js
  8. 0
      test/fixtures/readdir/these
  9. 31
      test/simple/test-readdir.js

0
test/fixtures/readdir/are

0
test/fixtures/readdir/dir/empty

0
test/fixtures/readdir/empty

0
test/fixtures/readdir/files

0
test/fixtures/readdir/for

0
test/fixtures/readdir/just

0
test/fixtures/readdir/testing.js

0
test/fixtures/readdir/these

31
test/simple/test-readdir.js

@ -1,30 +1,27 @@
process.mixin(require("../common")); process.mixin(require("../common"));
var got_error = false; var got_error = false,
readdirDir = path.join(fixturesDir, "readdir")
var files = ['a.js' var files = ['are'
, 'b' , 'dir'
, 'cycles' , 'empty'
, 'echo.js' , 'files'
, 'multipart.js' , 'for'
, 'nested-index' , 'just'
, 'print-chars.js' , 'testing.js'
, 'test_ca.pem' , 'these'
, 'test_cert.pem'
, 'test_key.pem'
, 'throws_error.js'
, 'x.txt'
]; ];
puts('readdirSync ' + fixturesDir); puts('readdirSync ' + readdirDir);
var f = fs.readdirSync(fixturesDir); var f = fs.readdirSync(readdirDir);
p(f); p(f);
assert.deepEqual(files, f.sort()); assert.deepEqual(files, f.sort());
puts("readdir " + fixturesDir); puts("readdir " + readdirDir);
fs.readdir(fixturesDir, function (err, f) { fs.readdir(readdirDir, function (err, f) {
if (err) { if (err) {
puts("error"); puts("error");
got_error = true; got_error = true;

Loading…
Cancel
Save