Browse Source

Add built-in module loading to test-require-cache-without-stat

v0.7.4-release
Ryan Dahl 14 years ago
parent
commit
c3b0d133aa
  1. 10
      test/simple/test-require-cache-without-stat.js

10
test/simple/test-require-cache-without-stat.js

@ -23,10 +23,11 @@ fs.stat = function() {
return _stat.apply(this, arguments);
};
// Load the module a.js once. It should become cached.
// Load the module 'a' and 'http' once. It should become cached.
var m = common.fixturesDir + '/a.js';
var m = common.fixturesDir + '/a';
require(m);
require('http');
console.log("counterBefore = %d", counter);
var counterBefore = counter;
@ -37,6 +38,11 @@ for (var i = 0; i < 100; i++) {
require(m);
}
// Do the same with a built-in module
for (var i = 0; i < 100; i++) {
require('http');
}
console.log("counterAfter = %d", counter);
var counterAfter = counter;

Loading…
Cancel
Save