Skip to content

Commit

Permalink
test-require-resolve: use case insensitive compare
Browse files Browse the repository at this point in the history
The test fixtures directory is derived from the path to the currently
running script, which is itself specified on the command line. That
means that the case of the fixtures dir may not match what the test
expects (when executed on a case-insensitive file system).

PR-URL: nodejs/node#116
Reviewed-By: Ben Noordhuis <[email protected]>
  • Loading branch information
piscisaureus committed Dec 23, 2014
1 parent f09e321 commit 9877cb4
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions test/simple/test-require-resolve.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,15 @@ var fixturesDir = common.fixturesDir;
var assert = require('assert');
var path = require('path');

assert.equal(path.join(__dirname, '../fixtures/a.js'),
path.normalize(require.resolve('../fixtures/a')));
assert.equal(path.join(fixturesDir, 'a.js'),
path.normalize(require.resolve(path.join(fixturesDir, 'a'))));
assert.equal(path.join(fixturesDir, 'nested-index', 'one', 'index.js'),
path.normalize(require.resolve('../fixtures/nested-index/one')));
assert.equal(
path.join(__dirname, '../fixtures/a.js').toLowerCase(),
require.resolve('../fixtures/a').toLowerCase());
assert.equal(
path.join(fixturesDir, 'a.js').toLowerCase(),
require.resolve(path.join(fixturesDir, 'a')).toLowerCase());
assert.equal(
path.join(fixturesDir, 'nested-index', 'one', 'index.js').toLowerCase(),
require.resolve('../fixtures/nested-index/one').toLowerCase());
assert.equal('path', require.resolve('path'));

console.log('ok');

0 comments on commit 9877cb4

Please sign in to comment.