Browse Source

Remove fs/path globals from test suite

It is way too easy to not notice bugs due to those modules being
exported as globals while running the test suite.

See: http://github.com/ry/node/issues#issue/75
v0.7.4-release
Felix Geisendörfer 15 years ago
committed by Ryan Dahl
parent
commit
44dde5f24c
  1. 4
      test/common.js
  2. 8
      test/simple/test-chdir.js
  3. 1
      test/simple/test-eio-race2.js
  4. 2
      test/simple/test-eio-race4.js
  5. 2
      test/simple/test-file-read-noexist.js
  6. 2
      test/simple/test-file-read-stream.js
  7. 2
      test/simple/test-file-write-stream.js
  8. 3
      test/simple/test-fs-chmod.js
  9. 3
      test/simple/test-fs-realpath.js
  10. 2
      test/simple/test-fs-stat.js
  11. 3
      test/simple/test-fs-symlink.js
  12. 3
      test/simple/test-fs-write.js
  13. 3
      test/simple/test-ini.js
  14. 2
      test/simple/test-mkdir-rmdir.js
  15. 1
      test/simple/test-module-loading.js
  16. 2
      test/simple/test-readdir.js
  17. 1
      test/simple/test-stdio.js
  18. 1
      test/simple/test-stdout-flush.js
  19. 2
      test/simple/test-sync-fileread.js

4
test/common.js

@ -11,6 +11,4 @@ var assert = require('assert');
var sys = require("sys");
process.mixin(exports, sys);
exports.assert = require('assert');
exports.fs = require("fs");
exports.path = path;
exports.assert = require('assert');

8
test/simple/test-chdir.js

@ -1,9 +1,7 @@
process.mixin(require("../common"));
var dirname = path.dirname(__filename);
assert.equal(true, process.cwd() !== __dirname);
assert.equal(true, process.cwd() !== dirname);
process.chdir(__dirname);
process.chdir(dirname);
assert.equal(true, process.cwd() === dirname);
assert.equal(true, process.cwd() === __dirname);

1
test/simple/test-eio-race2.js

@ -1,4 +1,5 @@
process.mixin(require("../common"));
var path = require('path');
var testTxt = path.join(fixturesDir, "x.txt");
var fs = require('fs');

2
test/simple/test-eio-race4.js

@ -1,5 +1,5 @@
process.mixin(require("../common"));
var fs = require('fs');
var N = 100;
var j = 0;

2
test/simple/test-file-read-noexist.js

@ -1,4 +1,6 @@
process.mixin(require("../common"));
var path = require('path');
var fs = require('fs');
var got_error = false;
var filename = path.join(fixturesDir, "does_not_exist.txt");

2
test/simple/test-file-read-stream.js

@ -1,6 +1,8 @@
process.mixin(require('../common'));
var
path = require('path'),
fs = require('fs'),
fn = path.join(fixturesDir, 'multipart.js'),
file = fs.createReadStream(fn),

2
test/simple/test-file-write-stream.js

@ -1,6 +1,8 @@
process.mixin(require('../common'));
var
path = require('path'),
fs = require('fs'),
fn = path.join(fixturesDir, "write.txt"),
file = fs.createWriteStream(fn),

3
test/simple/test-fs-chmod.js

@ -1,5 +1,6 @@
process.mixin(require("../common"));
var path = require('path');
var fs = require('fs');
var got_error = false;
var success_count = 0;

3
test/simple/test-fs-realpath.js

@ -1,5 +1,6 @@
process.mixin(require("../common"));
var fs = require('fs');
var path = require('path');
var async_completed = 0, async_expected = 0, unlink = [];
function asynctest(testBlock, args, callback, assertBlock) {

2
test/simple/test-fs-stat.js

@ -1,5 +1,5 @@
process.mixin(require("../common"));
var fs = require('fs');
var got_error = false;
var success_count = 0;

3
test/simple/test-fs-symlink.js

@ -1,5 +1,6 @@
process.mixin(require("../common"));
var path = require('path');
var fs = require('fs');
var completed = 0;
// test creating and reading symbolic link

3
test/simple/test-fs-write.js

@ -1,5 +1,6 @@
process.mixin(require("../common"));
var path = require('path');
var fs = require('fs');
var fn = path.join(fixturesDir, "write.txt");
var expected = "hello";
var found;

3
test/simple/test-ini.js

@ -1,5 +1,6 @@
process.mixin(require("../common"));
require("fs");
var path = require('path');
var fs = require("fs");
parse = require("ini").parse;
debug("load fixtures/fixture.ini");

2
test/simple/test-mkdir-rmdir.js

@ -1,4 +1,6 @@
process.mixin(require("../common"));
var path = require('path');
var fs = require('fs');
var dirname = path.dirname(__filename);
var fixtures = path.join(dirname, "../fixtures");

1
test/simple/test-module-loading.js

@ -1,4 +1,5 @@
process.mixin(require("../common"));
var path = require('path');
debug("load test-module-loading.js");

2
test/simple/test-readdir.js

@ -1,4 +1,6 @@
process.mixin(require("../common"));
var path = require('path');
var fs = require('fs');
var got_error = false,
readdirDir = path.join(fixturesDir, "readdir")

1
test/simple/test-stdio.js

@ -1,4 +1,5 @@
process.mixin(require("../common"));
var path = require('path');
var sub = path.join(fixturesDir, 'echo.js');

1
test/simple/test-stdout-flush.js

@ -1,4 +1,5 @@
process.mixin(require("../common"));
var path = require('path');
var sub = path.join(fixturesDir, 'print-chars.js');

2
test/simple/test-sync-fileread.js

@ -1,4 +1,6 @@
process.mixin(require('../common'));
var path = require('path');
var fs = require('fs');
var fixture = path.join(__dirname, "../fixtures/x.txt");

Loading…
Cancel
Save