forked from nodeSolidServer/node-solid-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutils.js
More file actions
28 lines (24 loc) · 967 Bytes
/
utils.js
File metadata and controls
28 lines (24 loc) · 967 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
var assert = require('chai').assert;
var utils = require('../lib/utils');
describe('Utility functions', function() {
describe('pathBasename', function() {
it('should return bar as relative path for /foo/bar', function() {
assert.equal(utils.pathBasename('/foo/bar'), 'bar');
});
it('should return empty as relative path for /foo/', function() {
assert.equal(utils.pathBasename('/foo/'), '');
});
it('should return empty as relative path for /', function() {
assert.equal(utils.pathBasename('/'), '');
});
it('should return empty as relative path for empty path', function() {
assert.equal(utils.pathBasename(''), '');
});
it('should return empty as relative path for undefined path', function() {
assert.equal(utils.pathBasename(undefined), '');
});
it('should properly decode a uri', function() {
assert.equal(utils.uriToFilename('uri%20', 'base/'), 'base/uri ')
});
});
});