summaryrefslogtreecommitdiff
path: root/test/simple
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2011-01-27 13:14:47 -0800
committerRyan Dahl <ry@tinyclouds.org>2011-01-27 14:02:43 -0800
commit6cdeb3b3fd16d261efefd340ec3dd30b6a441444 (patch)
tree40bff94b5e3b6a96a04164894b3a2eefe537ff4f /test/simple
parent36ef5643c3a3dc1a43e80ede442d4d1cd29b6a68 (diff)
downloadnode-new-6cdeb3b3fd16d261efefd340ec3dd30b6a441444.tar.gz
A module ID with a trailing slash must be a dir.
require('./foo/') should not try to load './foo.js'. It should only look for ./foo/index.js Closes GH-588
Diffstat (limited to 'test/simple')
-rw-r--r--test/simple/test-module-loading.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/simple/test-module-loading.js b/test/simple/test-module-loading.js
index a9aaf3a69b..6c09285057 100644
--- a/test/simple/test-module-loading.js
+++ b/test/simple/test-module-loading.js
@@ -52,6 +52,13 @@ var one = require('../fixtures/nested-index/one'),
two = require('../fixtures/nested-index/two');
assert.notEqual(one.hello, two.hello);
+common.debug('test index.js in a folder with a trailing slash');
+var three = require('../fixtures/nested-index/three'),
+ threeFolder = require('../fixtures/nested-index/three/'),
+ threeIndex = require('../fixtures/nested-index/three/index.js');
+assert.equal(threeFolder, threeIndex);
+assert.notEqual(threeFolder, three);
+
common.debug('test cycles containing a .. path');
var root = require('../fixtures/cycles/root'),
foo = require('../fixtures/cycles/folder/foo');