From 3497da370bc21f402eed9a455913399bc74d5dbf Mon Sep 17 00:00:00 2001 From: arlolra Date: Thu, 25 Feb 2010 19:32:30 -0500 Subject: [PATCH] Decoupled readdir test. --- 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 | 0 test/simple/test-readdir.js | 31 ++++++++++++++----------------- 9 files changed, 14 insertions(+), 17 deletions(-) create mode 100644 test/fixtures/readdir/are create mode 100644 test/fixtures/readdir/dir/empty create mode 100644 test/fixtures/readdir/empty create mode 100644 test/fixtures/readdir/files create mode 100644 test/fixtures/readdir/for create mode 100644 test/fixtures/readdir/just create mode 100644 test/fixtures/readdir/testing.js create mode 100644 test/fixtures/readdir/these diff --git a/test/fixtures/readdir/are b/test/fixtures/readdir/are new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/fixtures/readdir/dir/empty b/test/fixtures/readdir/dir/empty new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/fixtures/readdir/empty b/test/fixtures/readdir/empty new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/fixtures/readdir/files b/test/fixtures/readdir/files new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/fixtures/readdir/for b/test/fixtures/readdir/for new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/fixtures/readdir/just b/test/fixtures/readdir/just new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/fixtures/readdir/testing.js b/test/fixtures/readdir/testing.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/fixtures/readdir/these b/test/fixtures/readdir/these new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/simple/test-readdir.js b/test/simple/test-readdir.js index 0838a980c1..c65b06d5f0 100644 --- a/test/simple/test-readdir.js +++ b/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;