Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ddf2583

Browse filesBrowse files
silverwindjasnell
authored andcommitted
test: use normalize() for unicode paths
OS X 10.11 changed the unicode normalization form of certain code points returned by system calls like getcwd() from NFC to NFD which made results in this test failing. The consensus of #2165 is to delegate the task of unicode normalization to the user, and work will continue to document how to handle unicode in a form-sensitive file system. PR-URL: #3007 Fixes: #2165 Reviewed-By: Johan Bergström <bugs@bergstroem.nu> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
1 parent 63644dd commit ddf2583
Copy full SHA for ddf2583

File tree

Expand file treeCollapse file tree

1 file changed

+12
-4
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+12
-4
lines changed
Open diff view settings
Collapse file

‎test/parallel/test-process-chdir.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-process-chdir.js
+12-4Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,26 @@ assert.notStrictEqual(process.cwd(), __dirname);
99
process.chdir(__dirname);
1010
assert.strictEqual(process.cwd(), __dirname);
1111

12-
const dir = path.resolve(common.tmpDir,
13-
'weird \uc3a4\uc3ab\uc3af characters \u00e1\u00e2\u00e3');
12+
let dirName;
13+
if (process.versions.icu) {
14+
// ICU is available, use characters that could possibly be decomposed
15+
dirName = 'weird \uc3a4\uc3ab\uc3af characters \u00e1\u00e2\u00e3';
16+
} else {
17+
// ICU is unavailable, use characters that can't be decomposed
18+
dirName = 'weird \ud83d\udc04 characters \ud83d\udc05';
19+
}
20+
const dir = path.resolve(common.tmpDir, dirName);
1421

1522
// Make sure that the tmp directory is clean
1623
common.refreshTmpDir();
1724

1825
fs.mkdirSync(dir);
1926
process.chdir(dir);
20-
assert.strictEqual(process.cwd(), dir);
27+
assert.strictEqual(process.cwd().normalize(), dir.normalize());
2128

2229
process.chdir('..');
23-
assert.strictEqual(process.cwd(), path.resolve(common.tmpDir));
30+
assert.strictEqual(process.cwd().normalize(),
31+
path.resolve(common.tmpDir).normalize());
2432

2533
assert.throws(function() { process.chdir({}); }, TypeError, 'Bad argument.');
2634
assert.throws(function() { process.chdir(); }, TypeError, 'Bad argument.');

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.