source: node_modules/file-uri-to-path/test/test.js@ 81bc7da

finki-main main
Last change on this file since 81bc7da was 81bc7da, checked in by Klimentina Efremova <klimentina08642@…>, 3 months ago

Initial commit

  • Property mode set to 100644
File size: 666 bytes
RevLine 
[81bc7da]1
2var sep = require('path').sep || '/';
3var assert = require('assert');
4var uri2path = require('../');
5var tests = require('./tests.json');
6
7describe('file-uri-to-path', function () {
8
9 Object.keys(tests).forEach(function (uri) {
10
11 // the test cases were generated from Windows' PathCreateFromUrlA() function.
12 // On Unix, we have to replace the path separator with the Unix one instead of
13 // the Windows one.
14 var expected = tests[uri].replace(/\\/g, sep);
15
16 it('should convert ' + JSON.stringify(uri) + ' to ' + JSON.stringify(expected),
17 function () {
18 var actual = uri2path(uri);
19 assert.equal(actual, expected);
20 });
21
22 });
23
24});
Note: See TracBrowser for help on using the repository browser.