Files: 65191f9a9664f013ebe726bb95a1a54b086e1bd5 / test / test-50-fs-runtime-layer / test-x2-index.js
16400 bytesRaw
1 | /* eslint-disable brace-style */ |
2 | /* eslint-disable complexity */ |
3 | /* eslint-disable no-path-concat */ |
4 | |
5 | 'use strict'; |
6 | |
7 | var fs = require('fs'); |
8 | var path = require('path'); |
9 | var assert = require('assert'); |
10 | var theRequireContentA = './test-z-asset-A.css'; |
11 | var theRequireContentB = 'test-z-asset-B.css'; |
12 | |
13 | function firstLowerCase (s) { |
14 | return s.slice(0, 1).toLowerCase() + s.slice(1); |
15 | } |
16 | |
17 | function firstUpperCase (s) { |
18 | return s.slice(0, 1).toUpperCase() + s.slice(1); |
19 | } |
20 | |
21 | // /////////////////////////////////////////////////////////////////////////// |
22 | |
23 | fs.readFile(path.join(__dirname, theRequireContentA), function (e01, v01) { |
24 | fs.readFile(__dirname + path.sep + theRequireContentB, function (e02, v02) { |
25 | fs.readFile(__dirname + '/' + theRequireContentB, function (e03, v03) { |
26 | fs.readFile(firstLowerCase(path.join(__dirname, theRequireContentA)), function (e04, v04) { |
27 | fs.readFile(firstLowerCase(__dirname + path.sep + theRequireContentB), function (e05, v05) { |
28 | fs.readFile(firstLowerCase(__dirname + '/' + theRequireContentB), function (e06, v06) { |
29 | fs.readFile(firstUpperCase(path.join(__dirname, theRequireContentA)), function (e07, v07) { |
30 | fs.readFile(firstUpperCase(__dirname + path.sep + theRequireContentB), function (e08, v08) { |
31 | fs.readFile(firstUpperCase(__dirname + '/' + theRequireContentB), function (e09, v09) { |
32 | // |
33 | |
34 | fs.readFile(path.join(__dirname, theRequireContentA), { encoding: 'utf8' }, function (e01a, v01a) { |
35 | fs.readFile(__dirname + path.sep + theRequireContentB, { encoding: 'utf8' }, function (e02a, v02a) { |
36 | fs.readFile(__dirname + '/' + theRequireContentB, { encoding: 'utf8' }, function (e03a, v03a) { |
37 | fs.readFile(firstLowerCase(path.join(__dirname, theRequireContentA)), { encoding: 'utf8' }, function (e04a, v04a) { |
38 | fs.readFile(firstLowerCase(__dirname + path.sep + theRequireContentB), { encoding: 'utf8' }, function (e05a, v05a) { |
39 | fs.readFile(firstLowerCase(__dirname + '/' + theRequireContentB), { encoding: 'utf8' }, function (e06a, v06a) { |
40 | fs.readFile(firstUpperCase(path.join(__dirname, theRequireContentA)), { encoding: 'utf8' }, function (e07a, v07a) { |
41 | fs.readFile(firstUpperCase(__dirname + path.sep + theRequireContentB), { encoding: 'utf8' }, function (e08a, v08a) { |
42 | fs.readFile(firstUpperCase(__dirname + '/' + theRequireContentB), { encoding: 'utf8' }, function (e09a, v09a) { |
43 | // |
44 | |
45 | fs.readFile(path.join(__dirname, theRequireContentA + '-no-such'), function (e10, v10) { |
46 | fs.readFile(__dirname + path.sep + theRequireContentB + '-no-such', function (e11, v11) { |
47 | fs.readFile(__dirname + '/' + theRequireContentB + '-no-such', function (e12, v12) { |
48 | fs.readFile(firstLowerCase(path.join(__dirname, theRequireContentA + '-no-such')), function (e13, v13) { |
49 | fs.readFile(firstLowerCase(__dirname + path.sep + theRequireContentB + '-no-such'), function (e14, v14) { |
50 | fs.readFile(firstLowerCase(__dirname + '/' + theRequireContentB + '-no-such'), function (e15, v15) { |
51 | fs.readFile(firstUpperCase(path.join(__dirname, theRequireContentA + '-no-such')), function (e16, v16) { |
52 | fs.readFile(firstUpperCase(__dirname + path.sep + theRequireContentB + '-no-such'), function (e17, v17) { |
53 | fs.readFile(firstUpperCase(__dirname + '/' + theRequireContentB + '-no-such'), function (e18, v18) { |
54 | // |
55 | |
56 | fs.readFile(__dirname, function (e19, v19) { |
57 | fs.readFile(path.dirname(__dirname), function (e20, v20) { |
58 | fs.readFile(path.dirname(path.dirname(__dirname)), function (e21, v21) { |
59 | fs.readFile(firstLowerCase(__dirname), function (e22, v22) { |
60 | fs.readFile(firstLowerCase(path.dirname(__dirname)), function (e23, v23) { |
61 | fs.readFile(firstLowerCase(path.dirname(path.dirname(__dirname))), function (e24, v24) { |
62 | fs.readFile(firstUpperCase(__dirname), function (e25, v25) { |
63 | fs.readFile(firstUpperCase(path.dirname(__dirname)), function (e26, v26) { |
64 | fs.readFile(firstUpperCase(path.dirname(path.dirname(__dirname))), function (e27, v27) { |
65 | // |
66 | |
67 | fs.open(path.join(__dirname, theRequireContentA), 'r', function (e28, v28) { |
68 | fs.open(__dirname + path.sep + theRequireContentB, 'r', function (e29, v29) { |
69 | fs.open(__dirname + '/' + theRequireContentB, 'r', function (e30, v30) { |
70 | fs.open(firstLowerCase(path.join(__dirname, theRequireContentA)), 'r', function (e31, v31) { |
71 | fs.open(firstLowerCase(__dirname + path.sep + theRequireContentB), 'r', function (e32, v32) { |
72 | fs.open(firstLowerCase(__dirname + '/' + theRequireContentB), 'r', function (e33, v33) { |
73 | fs.open(firstUpperCase(path.join(__dirname, theRequireContentA)), 'r', function (e34, v34) { |
74 | fs.open(firstUpperCase(__dirname + path.sep + theRequireContentB), 'r', function (e35, v35) { |
75 | fs.open(firstUpperCase(__dirname + '/' + theRequireContentB), 'r', function (e36, v36) { |
76 | // |
77 | |
78 | fs.open(path.join(__dirname, theRequireContentA + '-no-such'), 'r', function (e37, v37) { |
79 | fs.open(__dirname + path.sep + theRequireContentB + '-no-such', 'r', function (e38, v38) { |
80 | fs.open(__dirname + '/' + theRequireContentB + '-no-such', 'r', function (e39, v39) { |
81 | fs.open(firstLowerCase(path.join(__dirname, theRequireContentA + '-no-such')), 'r', function (e40, v40) { |
82 | fs.open(firstLowerCase(__dirname + path.sep + theRequireContentB + '-no-such'), 'r', function (e41, v41) { |
83 | fs.open(firstLowerCase(__dirname + '/' + theRequireContentB + '-no-such'), 'r', function (e42, v42) { |
84 | fs.open(firstUpperCase(path.join(__dirname, theRequireContentA + '-no-such')), 'r', function (e43, v43) { |
85 | fs.open(firstUpperCase(__dirname + path.sep + theRequireContentB + '-no-such'), 'r', function (e44, v44) { |
86 | fs.open(firstUpperCase(__dirname + '/' + theRequireContentB + '-no-such'), 'r', function (e45, v45) { |
87 | // |
88 | |
89 | fs.open(__dirname, 'r', function (e46, v46) { |
90 | fs.open(path.dirname(__dirname), 'r', function (e47, v47) { |
91 | fs.open(path.dirname(__dirname), 'r', function (e48, v48) { // not "path.dirname(path.dirname" due to denominator |
92 | fs.open(firstLowerCase(__dirname), 'r', function (e49, v49) { |
93 | fs.open(firstLowerCase(path.dirname(__dirname)), 'r', function (e50, v50) { |
94 | fs.open(firstLowerCase(path.dirname(__dirname)), 'r', function (e51, v51) { // not "path.dirname(path.dirname" due to denominator |
95 | fs.open(firstUpperCase(__dirname), 'r', function (e52, v52) { |
96 | fs.open(firstUpperCase(path.dirname(__dirname)), 'r', function (e53, v53) { |
97 | fs.open(firstUpperCase(path.dirname(__dirname)), 'r', function (e54, v54) { // not "path.dirname(path.dirname" due to denominator |
98 | // |
99 | |
100 | fs.readdir(__dirname, function (e55, v55) { |
101 | fs.readdir(path.dirname(__dirname), function (e56, v56) { |
102 | fs.readdir(path.dirname(path.dirname(__dirname)), function (e57, v57) { |
103 | fs.readdir(firstLowerCase(__dirname), function (e58, v58) { |
104 | fs.readdir(firstLowerCase(path.dirname(__dirname)), function (e59, v59) { |
105 | fs.readdir(firstLowerCase(path.dirname(path.dirname(__dirname))), function (e60, v60) { |
106 | fs.readdir(firstUpperCase(__dirname), function (e61, v61) { |
107 | fs.readdir(firstUpperCase(path.dirname(__dirname)), function (e62, v62) { |
108 | fs.readdir(firstUpperCase(path.dirname(path.dirname(__dirname))), function (e63, v63) { |
109 | // |
110 | |
111 | fs.readdir(__dirname + '-no-such', function (e64, v64) { |
112 | fs.readdir(path.dirname(__dirname) + '-no-such', function (e65, v65) { |
113 | fs.readdir(path.dirname(path.dirname(__dirname)) + '-no-such', function (e66, v66) { |
114 | fs.readdir(firstLowerCase(__dirname + '-no-such'), function (e67, v67) { |
115 | fs.readdir(firstLowerCase(path.dirname(__dirname) + '-no-such'), function (e68, v68) { |
116 | fs.readdir(firstLowerCase(path.dirname(path.dirname(__dirname)) + '-no-such'), function (e69, v69) { |
117 | fs.readdir(firstUpperCase(__dirname + '-no-such'), function (e70, v70) { |
118 | fs.readdir(firstUpperCase(path.dirname(__dirname) + '-no-such'), function (e71, v71) { |
119 | fs.readdir(firstUpperCase(path.dirname(path.dirname(__dirname)) + '-no-such'), function (e72, v72) { |
120 | // |
121 | |
122 | fs.readdir(path.join(__dirname, theRequireContentA), function (e73, v73) { |
123 | fs.readdir(__dirname + path.sep + theRequireContentB, function (e74, v74) { |
124 | fs.readdir(__dirname + '/' + theRequireContentB, function (e75, v75) { |
125 | fs.readdir(firstLowerCase(path.join(__dirname, theRequireContentA)), function (e76, v76) { |
126 | fs.readdir(firstLowerCase(__dirname + path.sep + theRequireContentB), function (e77, v77) { |
127 | fs.readdir(firstLowerCase(__dirname + '/' + theRequireContentB), function (e78, v78) { |
128 | fs.readdir(firstUpperCase(path.join(__dirname, theRequireContentA)), function (e79, v79) { |
129 | fs.readdir(firstUpperCase(__dirname + path.sep + theRequireContentB), function (e80, v80) { |
130 | fs.readdir(firstUpperCase(__dirname + '/' + theRequireContentB), function (e81, v81) { |
131 | // |
132 | |
133 | fs.fstat(v28, function (e136, v136) { |
134 | fs.fstat(v29, function (e137, v137) { |
135 | fs.fstat(v30, function (e138, v138) { |
136 | fs.fstat(v46, function (e139, v139) { |
137 | fs.fstat(v47, function (e140, v140) { |
138 | fs.fstat(v48, function (e141, v141) { |
139 | fs.fstat(v49, function (e142, v142) { |
140 | fs.fstat(v50, function (e143, v143) { |
141 | fs.fstat(v51, function (e144, v144) { |
142 | console.log([ |
143 | |
144 | '******************************************************', |
145 | '******************************************************', |
146 | '******************************************************', |
147 | |
148 | 'readFile', assert(e01 === null), |
149 | e01 === null, v01.length, |
150 | e02 === null, v02.length, |
151 | e03 === null, v03.length, |
152 | e04 === null, v04.length, |
153 | e05 === null, v05.length, |
154 | e06 === null, v06.length, |
155 | e07 === null, v07.length, |
156 | e08 === null, v08.length, |
157 | e09 === null, v09.length, |
158 | |
159 | '******************************************************', |
160 | '******************************************************', |
161 | '******************************************************', |
162 | |
163 | 'readFile', assert(e01a === null), |
164 | e01a === null, v01a.length, |
165 | e02a === null, v02a.length, |
166 | e03a === null, v03a.length, |
167 | e04a === null, v04a.length, |
168 | e05a === null, v05a.length, |
169 | e06a === null, v06a.length, |
170 | e07a === null, v07a.length, |
171 | e08a === null, v08a.length, |
172 | e09a === null, v09a.length, |
173 | |
174 | '******************************************************', |
175 | '******************************************************', |
176 | '******************************************************', |
177 | |
178 | 'readFile-no-such', assert(e10.errno === -4058 || e10.errno === -2), |
179 | e10.errno, e10.code, v10 === undefined, |
180 | e11.errno, e11.code, v11 === undefined, |
181 | e12.errno, e12.code, v12 === undefined, |
182 | e13.errno, e13.code, v13 === undefined, |
183 | e14.errno, e14.code, v14 === undefined, |
184 | e15.errno, e15.code, v15 === undefined, |
185 | e16.errno, e16.code, v16 === undefined, |
186 | e17.errno, e17.code, v17 === undefined, |
187 | e18.errno, e18.code, v18 === undefined, |
188 | |
189 | '******************************************************', |
190 | '******************************************************', |
191 | '******************************************************', |
192 | |
193 | 'readFile-directory', assert(!e19 || e19.errno === -4068 || e19.errno === -21), |
194 | !e19 || e19.errno, !e19 || e19.code, v19 === undefined, |
195 | !e20 || e20.errno, !e20 || e20.code, v20 === undefined, |
196 | !e21 || e21.errno, !e21 || e21.code, v21 === undefined, |
197 | !e22 || e22.errno, !e22 || e22.code, v22 === undefined, |
198 | !e23 || e23.errno, !e23 || e23.code, v23 === undefined, |
199 | !e24 || e24.errno, !e24 || e24.code, v24 === undefined, |
200 | !e25 || e25.errno, !e25 || e25.code, v25 === undefined, |
201 | !e26 || e26.errno, !e26 || e26.code, v26 === undefined, |
202 | !e27 || e27.errno, !e27 || e27.code, v27 === undefined, |
203 | |
204 | '******************************************************', |
205 | '******************************************************', |
206 | '******************************************************', |
207 | |
208 | 'open', assert(e28 === null), |
209 | e28 === null, typeof v28, |
210 | e29 === null, typeof v29, |
211 | e30 === null, typeof v30, |
212 | e31 === null, typeof v31, |
213 | e32 === null, typeof v32, |
214 | e33 === null, typeof v33, |
215 | e34 === null, typeof v34, |
216 | e35 === null, typeof v35, |
217 | e36 === null, typeof v36, |
218 | |
219 | '******************************************************', |
220 | '******************************************************', |
221 | '******************************************************', |
222 | |
223 | 'open-no-such', assert(e37.errno === -4058 || e37.errno === -2), |
224 | e37.errno, e37.code, v37 === undefined, |
225 | e38.errno, e38.code, v38 === undefined, |
226 | e39.errno, e39.code, v39 === undefined, |
227 | e40.errno, e40.code, v40 === undefined, |
228 | e41.errno, e41.code, v41 === undefined, |
229 | e42.errno, e42.code, v42 === undefined, |
230 | e43.errno, e43.code, v43 === undefined, |
231 | e44.errno, e44.code, v44 === undefined, |
232 | e45.errno, e45.code, v45 === undefined, |
233 | |
234 | '******************************************************', |
235 | '******************************************************', |
236 | '******************************************************', |
237 | |
238 | 'open-directory', assert(e46 === null), |
239 | e46 === null, typeof v46, |
240 | e47 === null, typeof v47, |
241 | e48 === null, typeof v48, |
242 | e49 === null, typeof v49, |
243 | e50 === null, typeof v50, |
244 | e51 === null, typeof v51, |
245 | e52 === null, typeof v52, |
246 | e53 === null, typeof v53, |
247 | e54 === null, typeof v54, |
248 | |
249 | '******************************************************', |
250 | '******************************************************', |
251 | '******************************************************', |
252 | |
253 | 'readdir', assert(e55 === null), assert(v55.length > 0), |
254 | e55 === null, v55.length > 0, |
255 | e56 === null, v56.length > 0, |
256 | e57 === null, v57.length > 0, |
257 | e58 === null, v58.length > 0, |
258 | e59 === null, v59.length > 0, |
259 | e60 === null, v60.length > 0, |
260 | e61 === null, v61.length > 0, |
261 | e62 === null, v62.length > 0, |
262 | e63 === null, v63.length > 0, |
263 | |
264 | '******************************************************', |
265 | '******************************************************', |
266 | '******************************************************', |
267 | |
268 | 'readdir-no-such', assert(e64.errno === -4058 || e64.errno === -2), |
269 | e64.errno, e64.code, v64 === undefined, |
270 | e65.errno, e65.code, v65 === undefined, |
271 | e66.errno, e66.code, v66 === undefined, |
272 | e67.errno, e67.code, v67 === undefined, |
273 | e68.errno, e68.code, v68 === undefined, |
274 | e69.errno, e69.code, v69 === undefined, |
275 | e70.errno, e70.code, v70 === undefined, |
276 | e71.errno, e71.code, v71 === undefined, |
277 | e72.errno, e72.code, v72 === undefined, |
278 | |
279 | '******************************************************', |
280 | '******************************************************', |
281 | '******************************************************', |
282 | |
283 | 'readdir-file', assert(e73.errno === -4052 || e73.errno === -20), |
284 | e73.errno, e73.code, v73 === undefined, |
285 | e74.errno, e74.code, v74 === undefined, |
286 | e75.errno, e75.code, v75 === undefined, |
287 | e76.errno, e76.code, v76 === undefined, |
288 | e77.errno, e77.code, v77 === undefined, |
289 | e78.errno, e78.code, v78 === undefined, |
290 | e79.errno, e79.code, v79 === undefined, |
291 | e80.errno, e80.code, v80 === undefined, |
292 | e81.errno, e81.code, v81 === undefined, |
293 | |
294 | '******************************************************', |
295 | '******************************************************', |
296 | '******************************************************', |
297 | |
298 | 'fstat', assert(e136 === null), |
299 | e136 === null, v136.mode, v136.birthtime.getYear(), v136.isFile(), v136.isDirectory(), |
300 | e137 === null, v137.mode, v137.birthtime.getYear(), v137.isFile(), v137.isDirectory(), |
301 | e138 === null, v138.mode, v138.birthtime.getYear(), v138.isFile(), v138.isDirectory(), |
302 | e139 === null, v139.mode, v139.birthtime.getYear(), v139.isFile(), v139.isDirectory(), |
303 | e140 === null, v140.mode, v140.birthtime.getYear(), v140.isFile(), v140.isDirectory(), |
304 | e141 === null, v141.mode, v141.birthtime.getYear(), v141.isFile(), v141.isDirectory(), |
305 | e142 === null, v142.mode, v142.birthtime.getYear(), v142.isFile(), v142.isDirectory(), |
306 | e143 === null, v143.mode, v143.birthtime.getYear(), v143.isFile(), v143.isDirectory(), |
307 | e144 === null, v144.mode, v144.birthtime.getYear(), v144.isFile(), v144.isDirectory(), |
308 | |
309 | '******************************************************', |
310 | '******************************************************', |
311 | '******************************************************' |
312 | |
313 | ].join('\n')); |
314 | }); }); }); }); }); }); }); }); }); |
315 | }); }); }); }); }); }); }); }); }); |
316 | }); }); }); }); }); }); }); }); }); |
317 | }); }); }); }); }); }); }); }); }); |
318 | }); }); }); }); }); }); }); }); }); |
319 | }); }); }); }); }); }); }); }); }); |
320 | }); }); }); }); }); }); }); }); }); |
321 | }); }); }); }); }); }); }); }); }); |
322 | }); }); }); }); }); }); }); }); }); |
323 | }); }); }); }); }); }); }); }); }); |
324 | }); }); }); }); }); }); }); }); }); |
325 |
Built with git-ssb-web