Urara-Blog/node_modules/.pnpm-store/v3/files/25/6d204dd9dedcdaaac5925b31882f245675e4e0c518e9e18a129c1fab8c429946724fba9d045c76c522bc6bb5af3ee2eef32d783f2c6bdb68b6d3504428243b
2022-08-14 01:14:53 +08:00

24 lines
666 B
Text

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);
});
});
});