main.js 555 B

1234567891011121314151617
  1. 'use strict';
  2. var URIpath = require('..');
  3. require('should');
  4. describe('uri-path', function() {
  5. it('should convert relative file system paths into properly encoded URIs', function() {
  6. var paths = {
  7. // file system path: expected URI path
  8. '../abc/@#$%¨&()[]{}-_=+ß/môòñ 月 قمر': '../abc/%40%23%24%25%C2%A8%26()%5B%5D%7B%7D-_%3D%2B%C3%9F/m%C3%B4%C3%B2%C3%B1%20%E6%9C%88%20%D9%82%D9%85%D8%B1',
  9. 'a\\b\\c': 'a/b/c',
  10. };
  11. Object.keys(paths).forEach(function(filePath) {
  12. URIpath(filePath).should.equal(paths[filePath]);
  13. });
  14. });
  15. });