forked from rescript-lang/rescript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patha_filename_test.js
139 lines (120 loc) · 3.97 KB
/
a_filename_test.js
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
'use strict';
var Mt = require("./mt.js");
var $$Array = require("../../lib/js/array.js");
var Block = require("../../lib/js/block.js");
var Ext_filename_test = require("./ext_filename_test.js");
var suites = {
contents: /* [] */0
};
var test_id = {
contents: 0
};
function eq(loc, x, y) {
test_id.contents = test_id.contents + 1 | 0;
suites.contents = /* :: */[
/* tuple */[
loc + (" id " + String(test_id.contents)),
(function (param) {
return /* Eq */Block.__(0, [
x,
y
]);
})
],
suites.contents
];
return /* () */0;
}
function test(param, param$1) {
return Ext_filename_test.node_relative_path(true, param, param$1);
}
eq("File \"a_filename_test.ml\", line 10, characters 5-12", /* tuple */[
Ext_filename_test.combine("/tmp", "subdir/file.txt"),
Ext_filename_test.combine("/tmp", "/a/tmp.txt"),
Ext_filename_test.combine("/a/tmp.txt", "subdir/file.txt")
], /* tuple */[
"/tmp/subdir/file.txt",
"/a/tmp.txt",
"/a/tmp.txt/subdir/file.txt"
]);
eq("File \"a_filename_test.ml\", line 22, characters 5-12", Ext_filename_test.node_relative_path(true, /* `File */[
781515420,
"./a/b.c"
], /* `File */[
781515420,
"./a/u/g.c"
]), "./u/g.c");
eq("File \"a_filename_test.ml\", line 27, characters 5-12", Ext_filename_test.node_relative_path(true, /* `File */[
781515420,
"./a/b.c"
], /* `File */[
781515420,
"xxxghsoghos/ghsoghso/node_modules/buckle-stdlib/list.js"
]), "buckle-stdlib/list.js");
eq("File \"a_filename_test.ml\", line 33, characters 5-12", Ext_filename_test.node_relative_path(true, /* `File */[
781515420,
"./a/b.c"
], /* `File */[
781515420,
"xxxghsoghos/ghsoghso/node_modules//buckle-stdlib/list.js"
]), "buckle-stdlib/list.js");
eq("File \"a_filename_test.ml\", line 39, characters 5-12", Ext_filename_test.node_relative_path(true, /* `File */[
781515420,
"./a/b.c"
], /* `File */[
781515420,
"xxxghsoghos/ghsoghso/node_modules/./buckle-stdlib/list.js"
]), "buckle-stdlib/list.js");
eq("File \"a_filename_test.ml\", line 45, characters 5-12", Ext_filename_test.node_relative_path(true, /* `File */[
781515420,
"./a/c.js"
], /* `File */[
781515420,
"./a/b"
]), "./b");
eq("File \"a_filename_test.ml\", line 50, characters 5-12", Ext_filename_test.node_relative_path(true, /* `File */[
781515420,
"./a/c"
], /* `File */[
781515420,
"./a/b.js"
]), "./b.js");
eq("File \"a_filename_test.ml\", line 55, characters 5-12", Ext_filename_test.node_relative_path(true, /* `Dir */[
3405101,
"./a/"
], /* `File */[
781515420,
"./a/b.js"
]), "./b.js");
eq("File \"a_filename_test.ml\", line 60, characters 5-12", Ext_filename_test.get_extension("a.txt"), ".txt");
eq("File \"a_filename_test.ml\", line 64, characters 5-12", Ext_filename_test.get_extension("a"), "");
eq("File \"a_filename_test.ml\", line 68, characters 5-12", Ext_filename_test.get_extension(".txt"), ".txt");
eq("File \"a_filename_test.ml\", line 73, characters 5-12", $$Array.map(Ext_filename_test.normalize_absolute_path, /* array */[
"/gsho/./..",
"/a/b/../c../d/e/f",
"/a/b/../c/../d/e/f",
"/gsho/./../..",
"/a/b/c/d",
"/a/b/c/d/",
"/a/",
"/a",
"/a.txt/",
"/a.txt"
]), /* array */[
"/",
"/a/c../d/e/f",
"/a/d/e/f",
"/",
"/a/b/c/d",
"/a/b/c/d",
"/a",
"/a",
"/a.txt",
"/a.txt"
]);
Mt.from_pair_suites("A_filename_test", suites.contents);
exports.suites = suites;
exports.test_id = test_id;
exports.eq = eq;
exports.test = test;
/* Not a pure module */