Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/utils/tests/serverjs/file/normal.js
blob: 8314b1d0b5c133004f927025505bf10c5d41740f (plain)
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

var util = require('util');
var assert = require('test/assert');
var fs = require('file');

util.forEachApply([
    ['', ''],
    ['.', ''],
    ['./', ''],
    ['../', '../'],
    ['../a', '../a'],
    ['../a/', '../a/'],
    ['a/..', ''],
    ['a/../', ''],
    ['a/../b', 'b'],
    ['a/../b/', 'b/'],
], function (path, expected) {
    exports['test ' + util.repr(path)] = function () {
        var result = '';
        var actual = fs.normal(path);
        assert.eq(expected, actual, util.repr(path));
    };
});

if (require.main === module.id)
    require("os").exit(require("test/runner").run(exports));