aboutsummaryrefslogtreecommitdiff
path: root/test/known_issues
diff options
context:
space:
mode:
authorJames M Snell <jasnell@gmail.com>2016-08-26 21:12:59 -0700
committerJames M Snell <jasnell@gmail.com>2016-08-29 15:15:18 -0700
commit407069a29ddaa27664292070a306b0c63cc87f37 (patch)
treefd4422965802ed55c7edf34e9c6f751e8516cef8 /test/known_issues
parent49ef3ae90af7433b0ff29eb8519ae3bd6c9d58dd (diff)
downloadandroid-node-v8-407069a29ddaa27664292070a306b0c63cc87f37.tar.gz
android-node-v8-407069a29ddaa27664292070a306b0c63cc87f37.tar.bz2
android-node-v8-407069a29ddaa27664292070a306b0c63cc87f37.zip
test: add known issue test for path parse issue #6229
Refs: https://github.com/nodejs/node/issues/6229 PR-URL: https://github.com/nodejs/node/pull/8293 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'test/known_issues')
-rw-r--r--test/known_issues/test-path-parse-6229.js34
1 files changed, 34 insertions, 0 deletions
diff --git a/test/known_issues/test-path-parse-6229.js b/test/known_issues/test-path-parse-6229.js
new file mode 100644
index 0000000000..5096a97333
--- /dev/null
+++ b/test/known_issues/test-path-parse-6229.js
@@ -0,0 +1,34 @@
+'use strict';
+// Refs: https://github.com/nodejs/node/issues/6229
+
+require('../common');
+const assert = require('assert');
+const path = require('path');
+
+{
+ // The path `/foo/bar` is not the same path as `/foo/bar/`
+ const parsed1 = path.posix.parse('/foo/bar');
+ const parsed2 = path.posix.parse('/foo/bar/');
+
+ assert.strictEqual(parsed1.root, '/');
+ assert.strictEqual(parsed1.dir, '/foo');
+ assert.strictEqual(parsed1.base, 'bar');
+
+ assert.strictEqual(parsed2.root, '/');
+ assert.strictEqual(parsed2.dir, '/foo/bar');
+ assert.strictEqual(parsed2.base, '');
+}
+
+{
+ // The path `\\foo\\bar` is not the same path as `\\foo\\bar\\`
+ const parsed1 = path.win32.parse('\\foo\\bar');
+ const parsed2 = path.win32.parse('\\foo\\bar\\');
+
+ assert.strictEqual(parsed1.root, '\\');
+ assert.strictEqual(parsed1.dir, '\\foo');
+ assert.strictEqual(parsed1.base, 'bar');
+
+ assert.strictEqual(parsed2.root, '\\');
+ assert.strictEqual(parsed2.dir, '\\foo\\bar');
+ assert.strictEqual(parsed2.base, '');
+}