git ssb

0+

cel-desktop / ssb-pkg



Tree: 938b7ea4cfaa3cef6e1690b9ef3ea8bd7a0d2de1

Files: 938b7ea4cfaa3cef6e1690b9ef3ea8bd7a0d2de1 / test / test-50-fs-runtime-layer / test-x1-index.js

15928 bytesRaw
1/* eslint-disable brace-style */
2/* eslint-disable no-path-concat */
3
4'use strict';
5
6var fs = require('fs');
7var path = require('path');
8var windows = process.platform === 'win32';
9var theRequireContentA = './test-z-asset-A.css';
10var theRequireContentB = 'test-z-asset-B.css';
11
12function firstLowerCase (s) {
13 return s.slice(0, 1).toLowerCase() + s.slice(1);
14}
15
16function firstUpperCase (s) {
17 return s.slice(0, 1).toUpperCase() + s.slice(1);
18}
19
20console.log([
21
22 fs.readFileSync(path.join(__dirname, theRequireContentA)),
23 fs.readFileSync(__dirname + path.sep + theRequireContentB),
24 fs.readFileSync(__dirname + '/' + theRequireContentB),
25 windows ? fs.readFileSync(__dirname + '/\\' + theRequireContentB) : '',
26 windows ? fs.readFileSync(__dirname + '\\' + theRequireContentB) : '',
27 windows ? fs.readFileSync(__dirname + '\\/' + theRequireContentB) : '',
28
29 fs.readFileSync(firstLowerCase(path.join(__dirname, theRequireContentA))),
30 fs.readFileSync(firstLowerCase(__dirname + path.sep + theRequireContentB)),
31 fs.readFileSync(firstLowerCase(__dirname + '/' + theRequireContentB)),
32 windows ? fs.readFileSync(firstLowerCase(__dirname + '/\\' + theRequireContentB)) : '',
33 windows ? fs.readFileSync(firstLowerCase(__dirname + '\\' + theRequireContentB)) : '',
34 windows ? fs.readFileSync(firstLowerCase(__dirname + '\\/' + theRequireContentB)) : '',
35
36 fs.readFileSync(firstUpperCase(path.join(__dirname, theRequireContentA))),
37 fs.readFileSync(firstUpperCase(__dirname + path.sep + theRequireContentB)),
38 fs.readFileSync(firstUpperCase(__dirname + '/' + theRequireContentB)),
39 windows ? fs.readFileSync(firstUpperCase(__dirname + '/\\' + theRequireContentB)) : '',
40 windows ? fs.readFileSync(firstUpperCase(__dirname + '\\' + theRequireContentB)) : '',
41 windows ? fs.readFileSync(firstUpperCase(__dirname + '\\/' + theRequireContentB)) : '',
42
43 //
44
45 fs.readdirSync(__dirname).length > 0,
46 fs.readdirSync(path.dirname(__dirname)).length > 0,
47 fs.readdirSync(path.dirname(path.dirname(__dirname))).length > 0,
48
49 fs.readdirSync(firstLowerCase(__dirname)).length > 0,
50 fs.readdirSync(firstLowerCase(path.dirname(__dirname))).length > 0,
51 fs.readdirSync(firstLowerCase(path.dirname(path.dirname(__dirname)))).length > 0,
52
53 fs.readdirSync(firstUpperCase(__dirname)).length > 0,
54 fs.readdirSync(firstUpperCase(path.dirname(__dirname))).length > 0,
55 fs.readdirSync(firstUpperCase(path.dirname(path.dirname(__dirname)))).length > 0,
56
57 //
58
59 fs.existsSync(path.join(__dirname, theRequireContentA)),
60 fs.existsSync(__dirname + path.sep + theRequireContentB),
61 fs.existsSync(__dirname + '/' + theRequireContentB),
62 windows ? fs.existsSync(__dirname + '/\\' + theRequireContentB) : '',
63 windows ? fs.existsSync(__dirname + '\\' + theRequireContentB) : '',
64 windows ? fs.existsSync(__dirname + '\\/' + theRequireContentB) : '',
65
66 fs.existsSync(firstLowerCase(path.join(__dirname, theRequireContentA))),
67 fs.existsSync(firstLowerCase(__dirname + path.sep + theRequireContentB)),
68 fs.existsSync(firstLowerCase(__dirname + '/' + theRequireContentB)),
69 windows ? fs.existsSync(firstLowerCase(__dirname + '/\\' + theRequireContentB)) : '',
70 windows ? fs.existsSync(firstLowerCase(__dirname + '\\' + theRequireContentB)) : '',
71 windows ? fs.existsSync(firstLowerCase(__dirname + '\\/' + theRequireContentB)) : '',
72
73 fs.existsSync(firstUpperCase(path.join(__dirname, theRequireContentA))),
74 fs.existsSync(firstUpperCase(__dirname + path.sep + theRequireContentB)),
75 fs.existsSync(firstUpperCase(__dirname + '/' + theRequireContentB)),
76 windows ? fs.existsSync(firstUpperCase(__dirname + '/\\' + theRequireContentB)) : '',
77 windows ? fs.existsSync(firstUpperCase(__dirname + '\\' + theRequireContentB)) : '',
78 windows ? fs.existsSync(firstUpperCase(__dirname + '\\/' + theRequireContentB)) : '',
79
80 //
81
82 fs.existsSync(path.join(__dirname, theRequireContentA + '-no-such')),
83 fs.existsSync(__dirname + path.sep + theRequireContentB + '-no-such'),
84 fs.existsSync(__dirname + '/' + theRequireContentB + '-no-such'),
85 windows ? fs.existsSync(__dirname + '/\\' + theRequireContentB + '-no-such') : '',
86 windows ? fs.existsSync(__dirname + '\\' + theRequireContentB + '-no-such') : '',
87 windows ? fs.existsSync(__dirname + '\\/' + theRequireContentB + '-no-such') : '',
88
89 fs.existsSync(firstLowerCase(path.join(__dirname, theRequireContentA + '-no-such'))),
90 fs.existsSync(firstLowerCase(__dirname + path.sep + theRequireContentB + '-no-such')),
91 fs.existsSync(firstLowerCase(__dirname + '/' + theRequireContentB + '-no-such')),
92 windows ? fs.existsSync(firstLowerCase(__dirname + '/\\' + theRequireContentB + '-no-such')) : '',
93 windows ? fs.existsSync(firstLowerCase(__dirname + '\\' + theRequireContentB + '-no-such')) : '',
94 windows ? fs.existsSync(firstLowerCase(__dirname + '\\/' + theRequireContentB + '-no-such')) : '',
95
96 fs.existsSync(firstUpperCase(path.join(__dirname, theRequireContentA + '-no-such'))),
97 fs.existsSync(firstUpperCase(__dirname + path.sep + theRequireContentB + '-no-such')),
98 fs.existsSync(firstUpperCase(__dirname + '/' + theRequireContentB + '-no-such')),
99 windows ? fs.existsSync(firstUpperCase(__dirname + '/\\' + theRequireContentB + '-no-such')) : '',
100 windows ? fs.existsSync(firstUpperCase(__dirname + '\\' + theRequireContentB + '-no-such')) : '',
101 windows ? fs.existsSync(firstUpperCase(__dirname + '\\/' + theRequireContentB + '-no-such')) : '',
102
103 //
104
105 fs.accessSync(path.join(__dirname, theRequireContentA)),
106 fs.accessSync(__dirname + path.sep + theRequireContentB),
107 fs.accessSync(__dirname + '/' + theRequireContentB),
108 windows ? fs.accessSync(__dirname + '/\\' + theRequireContentB) : '',
109 windows ? fs.accessSync(__dirname + '\\' + theRequireContentB) : '',
110 windows ? fs.accessSync(__dirname + '\\/' + theRequireContentB) : '',
111
112 fs.accessSync(firstLowerCase(path.join(__dirname, theRequireContentA))),
113 fs.accessSync(firstLowerCase(__dirname + path.sep + theRequireContentB)),
114 fs.accessSync(firstLowerCase(__dirname + '/' + theRequireContentB)),
115 windows ? fs.accessSync(firstLowerCase(__dirname + '/\\' + theRequireContentB)) : '',
116 windows ? fs.accessSync(firstLowerCase(__dirname + '\\' + theRequireContentB)) : '',
117 windows ? fs.accessSync(firstLowerCase(__dirname + '\\/' + theRequireContentB)) : '',
118
119 fs.accessSync(firstUpperCase(path.join(__dirname, theRequireContentA))),
120 fs.accessSync(firstUpperCase(__dirname + path.sep + theRequireContentB)),
121 fs.accessSync(firstUpperCase(__dirname + '/' + theRequireContentB)),
122 windows ? fs.accessSync(firstUpperCase(__dirname + '/\\' + theRequireContentB)) : '',
123 windows ? fs.accessSync(firstUpperCase(__dirname + '\\' + theRequireContentB)) : '',
124 windows ? fs.accessSync(firstUpperCase(__dirname + '\\/' + theRequireContentB)) : '',
125
126 //
127
128 fs.statSync(path.join(__dirname, theRequireContentA)).mode,
129 fs.statSync(__dirname + path.sep + theRequireContentB).mode,
130 fs.statSync(__dirname + '/' + theRequireContentB).mode,
131 windows ? fs.statSync(__dirname + '/\\' + theRequireContentB).mode : '',
132 windows ? fs.statSync(__dirname + '\\' + theRequireContentB).mode : '',
133 windows ? fs.statSync(__dirname + '\\/' + theRequireContentB).mode : '',
134
135 fs.statSync(firstLowerCase(path.join(__dirname, theRequireContentA))).mode,
136 fs.statSync(firstLowerCase(__dirname + path.sep + theRequireContentB)).mode,
137 fs.statSync(firstLowerCase(__dirname + '/' + theRequireContentB)).mode,
138 windows ? fs.statSync(firstLowerCase(__dirname + '/\\' + theRequireContentB)).mode : '',
139 windows ? fs.statSync(firstLowerCase(__dirname + '\\' + theRequireContentB)).mode : '',
140 windows ? fs.statSync(firstLowerCase(__dirname + '\\/' + theRequireContentB)).mode : '',
141
142 fs.statSync(firstUpperCase(path.join(__dirname, theRequireContentA))).mode,
143 fs.statSync(firstUpperCase(__dirname + path.sep + theRequireContentB)).mode,
144 fs.statSync(firstUpperCase(__dirname + '/' + theRequireContentB)).mode,
145 windows ? fs.statSync(firstUpperCase(__dirname + '/\\' + theRequireContentB)).mode : '',
146 windows ? fs.statSync(firstUpperCase(__dirname + '\\' + theRequireContentB)).mode : '',
147 windows ? fs.statSync(firstUpperCase(__dirname + '\\/' + theRequireContentB)).mode : '',
148
149 //
150
151 fs.statSync(path.join(__dirname, theRequireContentA)).birthtime.getYear(),
152 fs.statSync(__dirname + path.sep + theRequireContentB).birthtime.getYear(),
153 fs.statSync(__dirname + '/' + theRequireContentB).birthtime.getYear(),
154 windows ? fs.statSync(__dirname + '/\\' + theRequireContentB).birthtime.getYear() : '',
155 windows ? fs.statSync(__dirname + '\\' + theRequireContentB).birthtime.getYear() : '',
156 windows ? fs.statSync(__dirname + '\\/' + theRequireContentB).birthtime.getYear() : '',
157
158 fs.statSync(firstLowerCase(path.join(__dirname, theRequireContentA))).birthtime.getYear(),
159 fs.statSync(firstLowerCase(__dirname + path.sep + theRequireContentB)).birthtime.getYear(),
160 fs.statSync(firstLowerCase(__dirname + '/' + theRequireContentB)).birthtime.getYear(),
161 windows ? fs.statSync(firstLowerCase(__dirname + '/\\' + theRequireContentB)).birthtime.getYear() : '',
162 windows ? fs.statSync(firstLowerCase(__dirname + '\\' + theRequireContentB)).birthtime.getYear() : '',
163 windows ? fs.statSync(firstLowerCase(__dirname + '\\/' + theRequireContentB)).birthtime.getYear() : '',
164
165 fs.statSync(firstUpperCase(path.join(__dirname, theRequireContentA))).birthtime.getYear(),
166 fs.statSync(firstUpperCase(__dirname + path.sep + theRequireContentB)).birthtime.getYear(),
167 fs.statSync(firstUpperCase(__dirname + '/' + theRequireContentB)).birthtime.getYear(),
168 windows ? fs.statSync(firstUpperCase(__dirname + '/\\' + theRequireContentB)).birthtime.getYear() : '',
169 windows ? fs.statSync(firstUpperCase(__dirname + '\\' + theRequireContentB)).birthtime.getYear() : '',
170 windows ? fs.statSync(firstUpperCase(__dirname + '\\/' + theRequireContentB)).birthtime.getYear() : '',
171
172 //
173
174 fs.statSync(path.join(__dirname, theRequireContentA)).isFile(),
175 fs.statSync(__dirname + path.sep + theRequireContentB).isFile(),
176 fs.statSync(__dirname + '/' + theRequireContentB).isFile(),
177 windows ? fs.statSync(__dirname + '/\\' + theRequireContentB).isFile() : '',
178 windows ? fs.statSync(__dirname + '\\' + theRequireContentB).isFile() : '',
179 windows ? fs.statSync(__dirname + '\\/' + theRequireContentB).isFile() : '',
180
181 fs.statSync(firstLowerCase(path.join(__dirname, theRequireContentA))).isFile(),
182 fs.statSync(firstLowerCase(__dirname + path.sep + theRequireContentB)).isFile(),
183 fs.statSync(firstLowerCase(__dirname + '/' + theRequireContentB)).isFile(),
184 windows ? fs.statSync(firstLowerCase(__dirname + '/\\' + theRequireContentB)).isFile() : '',
185 windows ? fs.statSync(firstLowerCase(__dirname + '\\' + theRequireContentB)).isFile() : '',
186 windows ? fs.statSync(firstLowerCase(__dirname + '\\/' + theRequireContentB)).isFile() : '',
187
188 fs.statSync(firstUpperCase(path.join(__dirname, theRequireContentA))).isFile(),
189 fs.statSync(firstUpperCase(__dirname + path.sep + theRequireContentB)).isFile(),
190 fs.statSync(firstUpperCase(__dirname + '/' + theRequireContentB)).isFile(),
191 windows ? fs.statSync(firstUpperCase(__dirname + '/\\' + theRequireContentB)).isFile() : '',
192 windows ? fs.statSync(firstUpperCase(__dirname + '\\' + theRequireContentB)).isFile() : '',
193 windows ? fs.statSync(firstUpperCase(__dirname + '\\/' + theRequireContentB)).isFile() : '',
194
195 //
196
197 fs.statSync(path.join(__dirname, theRequireContentA)).isDirectory(),
198 fs.statSync(__dirname + path.sep + theRequireContentB).isDirectory(),
199 fs.statSync(__dirname + '/' + theRequireContentB).isDirectory(),
200 windows ? fs.statSync(__dirname + '/\\' + theRequireContentB).isDirectory() : '',
201 windows ? fs.statSync(__dirname + '\\' + theRequireContentB).isDirectory() : '',
202 windows ? fs.statSync(__dirname + '\\/' + theRequireContentB).isDirectory() : '',
203
204 fs.statSync(firstLowerCase(path.join(__dirname, theRequireContentA))).isDirectory(),
205 fs.statSync(firstLowerCase(__dirname + path.sep + theRequireContentB)).isDirectory(),
206 fs.statSync(firstLowerCase(__dirname + '/' + theRequireContentB)).isDirectory(),
207 windows ? fs.statSync(firstLowerCase(__dirname + '/\\' + theRequireContentB)).isDirectory() : '',
208 windows ? fs.statSync(firstLowerCase(__dirname + '\\' + theRequireContentB)).isDirectory() : '',
209 windows ? fs.statSync(firstLowerCase(__dirname + '\\/' + theRequireContentB)).isDirectory() : '',
210
211 fs.statSync(firstUpperCase(path.join(__dirname, theRequireContentA))).isDirectory(),
212 fs.statSync(firstUpperCase(__dirname + path.sep + theRequireContentB)).isDirectory(),
213 fs.statSync(firstUpperCase(__dirname + '/' + theRequireContentB)).isDirectory(),
214 windows ? fs.statSync(firstUpperCase(__dirname + '/\\' + theRequireContentB)).isDirectory() : '',
215 windows ? fs.statSync(firstUpperCase(__dirname + '\\' + theRequireContentB)).isDirectory() : '',
216 windows ? fs.statSync(firstUpperCase(__dirname + '\\/' + theRequireContentB)).isDirectory() : '',
217
218 //
219
220 fs.lstatSync(path.join(__dirname, theRequireContentA)).mode,
221 fs.lstatSync(__dirname + path.sep + theRequireContentB).mode,
222 fs.lstatSync(__dirname + '/' + theRequireContentB).mode,
223 windows ? fs.lstatSync(__dirname + '/\\' + theRequireContentB).mode : '',
224 windows ? fs.lstatSync(__dirname + '\\' + theRequireContentB).mode : '',
225 windows ? fs.lstatSync(__dirname + '\\/' + theRequireContentB).mode : '',
226
227 fs.lstatSync(firstLowerCase(path.join(__dirname, theRequireContentA))).mode,
228 fs.lstatSync(firstLowerCase(__dirname + path.sep + theRequireContentB)).mode,
229 fs.lstatSync(firstLowerCase(__dirname + '/' + theRequireContentB)).mode,
230 windows ? fs.lstatSync(firstLowerCase(__dirname + '/\\' + theRequireContentB)).mode : '',
231 windows ? fs.lstatSync(firstLowerCase(__dirname + '\\' + theRequireContentB)).mode : '',
232 windows ? fs.lstatSync(firstLowerCase(__dirname + '\\/' + theRequireContentB)).mode : '',
233
234 fs.lstatSync(firstUpperCase(path.join(__dirname, theRequireContentA))).mode,
235 fs.lstatSync(firstUpperCase(__dirname + path.sep + theRequireContentB)).mode,
236 fs.lstatSync(firstUpperCase(__dirname + '/' + theRequireContentB)).mode,
237 windows ? fs.lstatSync(firstUpperCase(__dirname + '/\\' + theRequireContentB)).mode : '',
238 windows ? fs.lstatSync(firstUpperCase(__dirname + '\\' + theRequireContentB)).mode : '',
239 windows ? fs.lstatSync(firstUpperCase(__dirname + '\\/' + theRequireContentB)).mode : '',
240
241 //
242
243 fs.realpathSync(path.join(__dirname, theRequireContentA)).mode,
244 fs.realpathSync(__dirname + path.sep + theRequireContentB).mode,
245 fs.realpathSync(__dirname + '/' + theRequireContentB).mode,
246 windows ? fs.realpathSync(__dirname + '/\\' + theRequireContentB).mode : '',
247 windows ? fs.realpathSync(__dirname + '\\' + theRequireContentB).mode : '',
248 windows ? fs.realpathSync(__dirname + '\\/' + theRequireContentB).mode : '',
249
250 fs.realpathSync(firstLowerCase(path.join(__dirname, theRequireContentA))).mode,
251 fs.realpathSync(firstLowerCase(__dirname + path.sep + theRequireContentB)).mode,
252 fs.realpathSync(firstLowerCase(__dirname + '/' + theRequireContentB)).mode,
253 windows ? fs.realpathSync(firstLowerCase(__dirname + '/\\' + theRequireContentB)).mode : '',
254 windows ? fs.realpathSync(firstLowerCase(__dirname + '\\' + theRequireContentB)).mode : '',
255 windows ? fs.realpathSync(firstLowerCase(__dirname + '\\/' + theRequireContentB)).mode : '',
256
257 fs.realpathSync(firstUpperCase(path.join(__dirname, theRequireContentA))).mode,
258 fs.realpathSync(firstUpperCase(__dirname + path.sep + theRequireContentB)).mode,
259 fs.realpathSync(firstUpperCase(__dirname + '/' + theRequireContentB)).mode,
260 windows ? fs.realpathSync(firstUpperCase(__dirname + '/\\' + theRequireContentB)).mode : '',
261 windows ? fs.realpathSync(firstUpperCase(__dirname + '\\' + theRequireContentB)).mode : '',
262 windows ? fs.realpathSync(firstUpperCase(__dirname + '\\/' + theRequireContentB)).mode : ''
263
264].join('\n'));
265

Built with git-ssb-web