Skip to content
This repository has been archived by the owner. It is now read-only.
Browse files

Fix test-fs-realpath on Windows

Also, in the process, fix a bug in fs.realpath on Windows.

If the user has permission to create symlinks, then use symlinks.  If
not, then skip over all the tests that cannot be run using Junctions
  • Loading branch information...
isaacs committed Jun 14, 2012
1 parent 00247d5 commit 412c1ab5bc254906d8f68b22fdabef82dea1a15a
Showing with 166 additions and 92 deletions.
  1. +5 −1 lib/fs.js
  2. +161 −91 test/simple/test-fs-realpath.js
@@ -941,7 +941,11 @@ var normalize = pathModule.normalize;

// Regexp that finds the next partion of a (partial) path
// result is [base_with_slash, base], e.g. ['somedir/', 'somedir']
var nextPartRe = /(.*?)(?:[\/]+|$)/g;
if (isWindows) {
var nextPartRe = /(.*?)(?:[\/\\]+|$)/g;
} else {
var nextPartRe = /(.*?)(?:[\/]+|$)/g;

// Regex to split a windows path into three parts: [*, device, slash,
// tail] windows-only

0 comments on commit 412c1ab

Please sign in to comment.
You can’t perform that action at this time.