Debian Codegraph @

path2/test/windows/extname.js

raw
1 'use strict';
2
3 var f = 'test-path.js';
4
5 module.exports = exports = function (t, a) { exports.tests(t, a); };
6
7 exports.tests = function (t, a) {
8 a(t(f), '.js');
9
10 a(t(''), '');
11 a(t('/path/to/file'), '');
12 a(t('/path/to/file.ext'), '.ext');
13 a(t('/path.to/file.ext'), '.ext');
14 a(t('/path.to/file'), '');
15 a(t('/path.to/.file'), '');
16 a(t('/path.to/.file.ext'), '.ext');
17 a(t('/path/to/f.ext'), '.ext');
18 a(t('/path/to/..ext'), '.ext');
19 a(t('file'), '');
20 a(t('file.ext'), '.ext');
21 a(t('.file'), '');
22 a(t('.file.ext'), '.ext');
23 a(t('/file'), '');
24 a(t('/file.ext'), '.ext');
25 a(t('/.file'), '');
26 a(t('/.file.ext'), '.ext');
27 a(t('.path/file.ext'), '.ext');
28 a(t('file.ext.ext'), '.ext');
29 a(t('file.'), '.');
30 a(t('.'), '');
31 a(t('./'), '');
32 a(t('.file.ext'), '.ext');
33 a(t('.file'), '');
34 a(t('.file.'), '.');
35 a(t('.file..'), '.');
36 a(t('..'), '');
37 a(t('../'), '');
38 a(t('..file.ext'), '.ext');
39 a(t('..file'), '.file');
40 a(t('..file.'), '.');
41 a(t('..file..'), '.');
42 a(t('...'), '.');
43 a(t('...ext'), '.ext');
44 a(t('....'), '.');
45 a(t('file.ext/'), '.ext');
46 a(t('file.ext//'), '.ext');
47 a(t('file/'), '');
48 a(t('file//'), '');
49 a(t('file./'), '.');
50 a(t('file.//'), '.');
51
52 a(t('.\\'), '');
53 a(t('..\\'), '');
54 a(t('file.ext\\'), '.ext');
55 a(t('file.ext\\\\'), '.ext');
56 a(t('file\\'), '');
57 a(t('file\\\\'), '');
58 a(t('file.\\'), '.');
59 a(t('file.\\\\'), '.');
60
61 };