finki-main
main
|
Last change
on this file since 62b2964 was 81bc7da, checked in by Klimentina Efremova <klimentina08642@…>, 3 months ago |
|
Initial commit
|
-
Property mode
set to
100644
|
|
File size:
666 bytes
|
| Line | |
|---|
| 1 |
|
|---|
| 2 | var sep = require('path').sep || '/';
|
|---|
| 3 | var assert = require('assert');
|
|---|
| 4 | var uri2path = require('../');
|
|---|
| 5 | var tests = require('./tests.json');
|
|---|
| 6 |
|
|---|
| 7 | describe('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.