summaryrefslogtreecommitdiffstats
path: root/node_modules/file-uri-to-path/test/test.js
diff options
context:
space:
mode:
authorGravatar Piotr Russ <mail@pruss.it> 2020-11-16 00:10:28 +0100
committerGravatar Piotr Russ <mail@pruss.it> 2020-11-16 00:10:28 +0100
commite06ec920f7a5d784e674c4c4b4e6d1da3dc7391d (patch)
tree55713f725f77b44ebfec86e4eec3ce33e71458ca /node_modules/file-uri-to-path/test/test.js
downloadwebsite_creator-e06ec920f7a5d784e674c4c4b4e6d1da3dc7391d.tar.gz
website_creator-e06ec920f7a5d784e674c4c4b4e6d1da3dc7391d.tar.bz2
website_creator-e06ec920f7a5d784e674c4c4b4e6d1da3dc7391d.zip
api, login, auth
Diffstat (limited to 'node_modules/file-uri-to-path/test/test.js')
-rw-r--r--node_modules/file-uri-to-path/test/test.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/node_modules/file-uri-to-path/test/test.js b/node_modules/file-uri-to-path/test/test.js
new file mode 100644
index 0000000..79305dc
--- /dev/null
+++ b/node_modules/file-uri-to-path/test/test.js
@@ -0,0 +1,24 @@
+
+var sep = require('path').sep || '/';
+var assert = require('assert');
+var uri2path = require('../');
+var tests = require('./tests.json');
+
+describe('file-uri-to-path', function () {
+
+ Object.keys(tests).forEach(function (uri) {
+
+ // the test cases were generated from Windows' PathCreateFromUrlA() function.
+ // On Unix, we have to replace the path separator with the Unix one instead of
+ // the Windows one.
+ var expected = tests[uri].replace(/\\/g, sep);
+
+ it('should convert ' + JSON.stringify(uri) + ' to ' + JSON.stringify(expected),
+ function () {
+ var actual = uri2path(uri);
+ assert.equal(actual, expected);
+ });
+
+ });
+
+});