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"));
var got_error = false;
var got_error = false,
readdirDir = path.join(fixturesDir, "readdir")
var files = ['a.js'
, 'b'
, 'cycles'
, 'echo.js'
, 'multipart.js'
, 'nested-index'
, 'print-chars.js'
, 'test_ca.pem'
, 'test_cert.pem'
, 'test_key.pem'
, 'throws_error.js'
, 'x.txt'
var files = ['are'
, 'dir'
, 'empty'
, 'files'
, 'for'
, 'just'
, 'testing.js'
, 'these'
];
puts('readdirSync ' + fixturesDir);
var f = fs.readdirSync(fixturesDir);
puts('readdirSync ' + readdirDir);
var f = fs.readdirSync(readdirDir);
p(f);
assert.deepEqual(files, f.sort());
puts("readdir " + fixturesDir);
fs.readdir(fixturesDir, function (err, f) {
puts("readdir " + readdirDir);
fs.readdir(readdirDir, function (err, f) {
if (err) {
puts("error");
got_error = true;

Loading…
Cancel
Save