1 | Unit FileUtilsUnitTests;
|
---|
2 |
|
---|
3 | // NewView - a new OS/2 Help Viewer
|
---|
4 | // Copyright 2006-2009 Ronald Brill (rbri at rbri dot de)
|
---|
5 | // This software is released under the GNU Public License - see readme.txt
|
---|
6 |
|
---|
7 | // UnitTests for FileUtilsUnit
|
---|
8 |
|
---|
9 | Interface
|
---|
10 |
|
---|
11 | uses
|
---|
12 | Classes,
|
---|
13 | TestAssert,
|
---|
14 | FileUtilsUnit;
|
---|
15 |
|
---|
16 | const
|
---|
17 | // TODO read environment var
|
---|
18 | TEST_PATH = 'P:\newview_dev';
|
---|
19 |
|
---|
20 | FUNCTION getFileUtilsUnitTests : TList;
|
---|
21 |
|
---|
22 |
|
---|
23 | Implementation
|
---|
24 |
|
---|
25 | Procedure testAddDirectorySeparator_Empty;
|
---|
26 | var
|
---|
27 | tmpResult : String;
|
---|
28 | begin
|
---|
29 | tmpResult := AddDirectorySeparator('');
|
---|
30 |
|
---|
31 | assertEqualsString('testAddDirectorySeparator_Empty', '\', tmpResult);
|
---|
32 | end;
|
---|
33 |
|
---|
34 | Procedure testAddDirectorySeparator_SingleChar;
|
---|
35 | var
|
---|
36 | tmpResult : String;
|
---|
37 | begin
|
---|
38 | tmpResult := AddDirectorySeparator('x');
|
---|
39 |
|
---|
40 | assertEqualsString('testAddDirectorySeparator_SingleChar', 'x\', tmpResult);
|
---|
41 | end;
|
---|
42 |
|
---|
43 | Procedure testAddDirectorySeparator_ManyChars;
|
---|
44 | var
|
---|
45 | tmpResult : String;
|
---|
46 | begin
|
---|
47 | tmpResult := AddDirectorySeparator('xyz dkdj ');
|
---|
48 |
|
---|
49 | assertEqualsString('testAddDirectorySeparator_ManyChars', 'xyz dkdj \', tmpResult);
|
---|
50 | end;
|
---|
51 |
|
---|
52 |
|
---|
53 | Procedure testAddDirectorySeparator_SlashAtEnd;
|
---|
54 | var
|
---|
55 | tmpResult : String;
|
---|
56 | begin
|
---|
57 | tmpResult := AddDirectorySeparator('xy\');
|
---|
58 |
|
---|
59 | assertEqualsString('testAddDirectorySeparator_SlashAtEnd', 'xy\', tmpResult);
|
---|
60 | end;
|
---|
61 |
|
---|
62 |
|
---|
63 | // ----------------------------------------------------------
|
---|
64 |
|
---|
65 |
|
---|
66 | Procedure testAddDirectorySeparatorIfNotEmpty_Empty;
|
---|
67 | var
|
---|
68 | tmpResult : String;
|
---|
69 | begin
|
---|
70 | tmpResult := AddDirectorySeparatorIfNotEmpty('');
|
---|
71 |
|
---|
72 | assertEqualsString('testAddDirectorySeparatorIfNotEmpty_Empty', '', tmpResult);
|
---|
73 | end;
|
---|
74 |
|
---|
75 | Procedure testAddDirectorySeparatorIfNotEmpty_SingleChar;
|
---|
76 | var
|
---|
77 | tmpResult : String;
|
---|
78 | begin
|
---|
79 | tmpResult := AddDirectorySeparatorIfNotEmpty('x');
|
---|
80 |
|
---|
81 | assertEqualsString('testAddDirectorySeparatorIfNotEmpty_SingleChar', 'x\', tmpResult);
|
---|
82 | end;
|
---|
83 |
|
---|
84 | Procedure testAddDirectorySeparatorIfNotEmpty_ManyChars;
|
---|
85 | var
|
---|
86 | tmpResult : String;
|
---|
87 | begin
|
---|
88 | tmpResult := AddDirectorySeparatorIfNotEmpty('xyz dkdj ');
|
---|
89 |
|
---|
90 | assertEqualsString('testAddDirectorySeparatorIfNotEmpty_ManyChars', 'xyz dkdj \', tmpResult);
|
---|
91 | end;
|
---|
92 |
|
---|
93 |
|
---|
94 | Procedure testAddDirectorySeparatorIfNotEmpty_SlashAtEnd;
|
---|
95 | var
|
---|
96 | tmpResult : String;
|
---|
97 | begin
|
---|
98 | tmpResult := AddDirectorySeparatorIfNotEmpty('xy\');
|
---|
99 |
|
---|
100 | assertEqualsString('testAddDirectorySeparatorIfNotEmpty_SlashAtEnd', 'xy\', tmpResult);
|
---|
101 | end;
|
---|
102 |
|
---|
103 |
|
---|
104 | // ----------------------------------------------------------
|
---|
105 |
|
---|
106 |
|
---|
107 | Procedure testRemoveRightDirectorySeparator_Empty;
|
---|
108 | var
|
---|
109 | tmpResult : String;
|
---|
110 | begin
|
---|
111 | tmpResult := RemoveRightDirectorySeparator('');
|
---|
112 |
|
---|
113 | assertEqualsString('testRemoveRightDirectorySeparator_Empty', '', tmpResult);
|
---|
114 | end;
|
---|
115 |
|
---|
116 |
|
---|
117 | Procedure testRemoveRightDirectorySeparator_WithoutSlash;
|
---|
118 | var
|
---|
119 | tmpResult : String;
|
---|
120 | begin
|
---|
121 | tmpResult := RemoveRightDirectorySeparator('abc');
|
---|
122 |
|
---|
123 | assertEqualsString('testRemoveRightDirectorySeparator_WithoutSlash', 'abc', tmpResult);
|
---|
124 | end;
|
---|
125 |
|
---|
126 |
|
---|
127 | Procedure testRemoveRightDirectorySeparator_WithSlash;
|
---|
128 | var
|
---|
129 | tmpResult : String;
|
---|
130 | begin
|
---|
131 | tmpResult := RemoveRightDirectorySeparator('abc\');
|
---|
132 |
|
---|
133 | assertEqualsString('testRemoveRightDirectorySeparator_WithSlash', 'abc', tmpResult);
|
---|
134 | end;
|
---|
135 |
|
---|
136 |
|
---|
137 | // ----------------------------------------------------------
|
---|
138 |
|
---|
139 | Procedure testExpandPath_BothEmpty;
|
---|
140 | var
|
---|
141 | tmpResult : String;
|
---|
142 | begin
|
---|
143 | tmpResult := ExpandPath('', '');
|
---|
144 |
|
---|
145 | assertEqualsString('testExpandPath_BothEmpty', '', tmpResult);
|
---|
146 | end;
|
---|
147 |
|
---|
148 |
|
---|
149 | Procedure testExpandPath_PathEmpty;
|
---|
150 | var
|
---|
151 | tmpResult : String;
|
---|
152 | begin
|
---|
153 | tmpResult := ExpandPath('\abc\def', '');
|
---|
154 |
|
---|
155 | assertEqualsString('testExpandPath_PathEmpty', '\abc\def', tmpResult);
|
---|
156 | end;
|
---|
157 |
|
---|
158 |
|
---|
159 | Procedure testExpandPath_PathEmptyDirEndsWithSlash;
|
---|
160 | var
|
---|
161 | tmpResult : String;
|
---|
162 | begin
|
---|
163 | tmpResult := ExpandPath('\abc\def\', '');
|
---|
164 |
|
---|
165 | assertEqualsString('testExpandPath_PathEmpty', '\abc\def', tmpResult);
|
---|
166 | end;
|
---|
167 |
|
---|
168 |
|
---|
169 | Procedure testExpandPath_AbsolutePath;
|
---|
170 | var
|
---|
171 | tmpResult : String;
|
---|
172 | begin
|
---|
173 | tmpResult := ExpandPath('\abc\def', 'c:\test');
|
---|
174 |
|
---|
175 | assertEqualsString('testExpandPath_AbsolutePath', 'c:\test', tmpResult);
|
---|
176 | end;
|
---|
177 |
|
---|
178 |
|
---|
179 | Procedure testExpandPath_DriveWithSlash;
|
---|
180 | var
|
---|
181 | tmpResult : String;
|
---|
182 | begin
|
---|
183 | tmpResult := ExpandPath('\abc\def', 'c:\');
|
---|
184 |
|
---|
185 | assertEqualsString('testExpandPath_DriveWithSlash', 'c:\', tmpResult);
|
---|
186 | end;
|
---|
187 |
|
---|
188 |
|
---|
189 | Procedure testExpandPath_DriveWithoutSlash;
|
---|
190 | var
|
---|
191 | tmpResult : String;
|
---|
192 | begin
|
---|
193 | tmpResult := ExpandPath('\abc\def', 'c:');
|
---|
194 |
|
---|
195 | assertEqualsString('testExpandPath_DriveWithoutSlash', 'c:\', tmpResult);
|
---|
196 | end;
|
---|
197 |
|
---|
198 |
|
---|
199 | Procedure testExpandPath_RootPathForDrive;
|
---|
200 | var
|
---|
201 | tmpResult : String;
|
---|
202 | begin
|
---|
203 | tmpResult := ExpandPath('d:\abc\def', '\');
|
---|
204 |
|
---|
205 | assertEqualsString('testExpandPath_RootPathForDrive', 'd:\', tmpResult);
|
---|
206 | end;
|
---|
207 |
|
---|
208 |
|
---|
209 | Procedure testExpandPath_RootDirForDrive;
|
---|
210 | var
|
---|
211 | tmpResult : String;
|
---|
212 | begin
|
---|
213 | tmpResult := ExpandPath('d:\abc\def', '\xy');
|
---|
214 |
|
---|
215 | assertEqualsString('testExpandPath_RootDirForDrive', 'd:\xy', tmpResult);
|
---|
216 | end;
|
---|
217 |
|
---|
218 |
|
---|
219 | Procedure testExpandPath_RootPathWithoutDrive;
|
---|
220 | var
|
---|
221 | tmpResult : String;
|
---|
222 | begin
|
---|
223 | tmpResult := ExpandPath('abc\def', '\');
|
---|
224 |
|
---|
225 | assertEqualsString('testExpandPath_RootPathWithoutDrive', '\', tmpResult);
|
---|
226 | end;
|
---|
227 |
|
---|
228 |
|
---|
229 | Procedure testExpandPath_RootDirWithoutDrive;
|
---|
230 | var
|
---|
231 | tmpResult : String;
|
---|
232 | begin
|
---|
233 | tmpResult := ExpandPath('abc\def', '\xyz');
|
---|
234 |
|
---|
235 | assertEqualsString('testExpandPath_RootDirWithoutDrive', '\xyz', tmpResult);
|
---|
236 | end;
|
---|
237 |
|
---|
238 |
|
---|
239 | Procedure testExpandPath_AppendWithSlash;
|
---|
240 | var
|
---|
241 | tmpResult : String;
|
---|
242 | begin
|
---|
243 | tmpResult := ExpandPath('abc\def\', 'xyz');
|
---|
244 |
|
---|
245 | assertEqualsString('testExpandPath_AppendWithSlash', 'abc\def\xyz', tmpResult);
|
---|
246 | end;
|
---|
247 |
|
---|
248 |
|
---|
249 | Procedure testExpandPath_AppendWithoutSlash;
|
---|
250 | var
|
---|
251 | tmpResult : String;
|
---|
252 | begin
|
---|
253 | tmpResult := ExpandPath('abc\def', 'xyz');
|
---|
254 |
|
---|
255 | assertEqualsString('testExpandPath_AppendWithoutSlash', 'abc\def\xyz', tmpResult);
|
---|
256 | end;
|
---|
257 |
|
---|
258 |
|
---|
259 | Procedure testExpandPath_AppendWithSlashAtEnd;
|
---|
260 | var
|
---|
261 | tmpResult : String;
|
---|
262 | begin
|
---|
263 | tmpResult := ExpandPath('abc\def', 'xyz\');
|
---|
264 |
|
---|
265 | assertEqualsString('testExpandPath_AppendWithSlashAtEnd', 'abc\def\xyz', tmpResult);
|
---|
266 | end;
|
---|
267 |
|
---|
268 |
|
---|
269 | Procedure testExpandPath_WithDot;
|
---|
270 | var
|
---|
271 | tmpResult : String;
|
---|
272 | begin
|
---|
273 | tmpResult := ExpandPath('abc\def', 'xyz\.\abc');
|
---|
274 |
|
---|
275 | assertEqualsString('testExpandPath_WithDot', 'abc\def\xyz\abc', tmpResult);
|
---|
276 | end;
|
---|
277 |
|
---|
278 |
|
---|
279 | Procedure testExpandPath_WithDotAtEnd;
|
---|
280 | var
|
---|
281 | tmpResult : String;
|
---|
282 | begin
|
---|
283 | tmpResult := ExpandPath('abc\def', 'xyz\.');
|
---|
284 |
|
---|
285 | assertEqualsString('testExpandPath_WithDotAtEnd', 'abc\def\xyz', tmpResult);
|
---|
286 | end;
|
---|
287 |
|
---|
288 |
|
---|
289 | Procedure testExpandPath_WithDots;
|
---|
290 | var
|
---|
291 | tmpResult : String;
|
---|
292 | begin
|
---|
293 | tmpResult := ExpandPath('abc\def', 'xyz\..\abc');
|
---|
294 |
|
---|
295 | assertEqualsString('testExpandPath_WithDots', 'abc\def\abc', tmpResult);
|
---|
296 | end;
|
---|
297 |
|
---|
298 |
|
---|
299 | Procedure testExpandPath_WithDotsAtEnd;
|
---|
300 | var
|
---|
301 | tmpResult : String;
|
---|
302 | begin
|
---|
303 | tmpResult := ExpandPath('abc\def', 'xyz\..');
|
---|
304 |
|
---|
305 | assertEqualsString('testExpandPath_WithDotsAtEnd', 'abc\def', tmpResult);
|
---|
306 | end;
|
---|
307 |
|
---|
308 |
|
---|
309 | Procedure testExpandPath_WithDotsInFront;
|
---|
310 | var
|
---|
311 | tmpResult : String;
|
---|
312 | begin
|
---|
313 | tmpResult := ExpandPath('abc\def', '..\xyz');
|
---|
314 |
|
---|
315 | assertEqualsString('testExpandPath_WithDotsInFront', 'abc\xyz', tmpResult);
|
---|
316 | end;
|
---|
317 |
|
---|
318 |
|
---|
319 | Procedure testExpandPath_WithDotsInFrontReachingRoot;
|
---|
320 | var
|
---|
321 | tmpResult : String;
|
---|
322 | begin
|
---|
323 | tmpResult := ExpandPath('abc\def', '..\..\xyz');
|
---|
324 |
|
---|
325 | assertEqualsString('testExpandPath_WithDotsInFrontReachingRoot', '\xyz', tmpResult);
|
---|
326 | end;
|
---|
327 |
|
---|
328 |
|
---|
329 | Procedure testExpandPath_WithDotsInFrontReachingDrive;
|
---|
330 | var
|
---|
331 | tmpResult : String;
|
---|
332 | begin
|
---|
333 | tmpResult := ExpandPath('c:\abc\def', '..\..\xyz');
|
---|
334 |
|
---|
335 | assertEqualsString('testExpandPath_WithDotsInFront', 'c:\xyz', tmpResult);
|
---|
336 | end;
|
---|
337 |
|
---|
338 |
|
---|
339 | Procedure testExpandPath_WithDotsInFrontLeavingRoot;
|
---|
340 | var
|
---|
341 | tmpResult : String;
|
---|
342 | begin
|
---|
343 | tmpResult := ExpandPath('abc\def', '..\..\..\xyz');
|
---|
344 |
|
---|
345 | assertEqualsString('testExpandPath_WithDotsInFrontLeavingRoot', '\xyz', tmpResult);
|
---|
346 | end;
|
---|
347 |
|
---|
348 |
|
---|
349 | Procedure testExpandPath_WithDotsInFrontLeavingDrive;
|
---|
350 | var
|
---|
351 | tmpResult : String;
|
---|
352 | begin
|
---|
353 | tmpResult := ExpandPath('c:\abc\def', '..\..\..\xyz');
|
---|
354 |
|
---|
355 | assertEqualsString('testExpandPath_WithDotsInFrontLeavingDrive', 'c:\xyz', tmpResult);
|
---|
356 | end;
|
---|
357 |
|
---|
358 |
|
---|
359 | // ----------------------------------------------------------
|
---|
360 |
|
---|
361 |
|
---|
362 | Procedure testGetLogFilesDir;
|
---|
363 | var
|
---|
364 | tmpResult : String;
|
---|
365 | begin
|
---|
366 | tmpResult := GetLogFilesDir;
|
---|
367 |
|
---|
368 | assertEqualsString('testGetLogFilesDir', 'C:\var\log\', tmpResult);
|
---|
369 | end;
|
---|
370 |
|
---|
371 |
|
---|
372 | // ----------------------------------------------------------
|
---|
373 |
|
---|
374 | Procedure testSearchPath_Found;
|
---|
375 | var
|
---|
376 | tmpResult : Boolean;
|
---|
377 | tmpResultFilename : String;
|
---|
378 | begin
|
---|
379 | tmpResult := SearchPath('BOOKSHELF', 'CMDREF.INF', tmpResultFilename);
|
---|
380 |
|
---|
381 | assertTrue('testSearchPath_Found', tmpResult);
|
---|
382 | assertEqualsString('testSearchPath_Found', 'C:\OS2\BOOK\CMDREF.INF', tmpResultFilename);
|
---|
383 | end;
|
---|
384 |
|
---|
385 |
|
---|
386 | Procedure testSearchPath_FoundMixedCase;
|
---|
387 | var
|
---|
388 | tmpResult : Boolean;
|
---|
389 | tmpResultFilename : String;
|
---|
390 | begin
|
---|
391 | tmpResult := SearchPath('BOOKSHELF', 'cMdRef.iNf', tmpResultFilename);
|
---|
392 |
|
---|
393 | assertTrue('testSearchPath_FoundMixedCase', tmpResult);
|
---|
394 | assertEqualsString('testSearchPath_FoundMixedCase', 'C:\OS2\BOOK\cMdRef.iNf', tmpResultFilename);
|
---|
395 | end;
|
---|
396 |
|
---|
397 |
|
---|
398 | Procedure testSearchPath_NotFound;
|
---|
399 | var
|
---|
400 | tmpResult : Boolean;
|
---|
401 | tmpResultFilename : String;
|
---|
402 | begin
|
---|
403 | tmpResult := SearchPath('BOOKSHELF', 'RBRi.INF', tmpResultFilename);
|
---|
404 |
|
---|
405 | assertFalse('testSearchPath_NotFound', tmpResult);
|
---|
406 | assertEqualsString('testSearchPath_NotFound', '', tmpResultFilename);
|
---|
407 | end;
|
---|
408 |
|
---|
409 |
|
---|
410 | Procedure testSearchPath_NotExistingEnvironment;
|
---|
411 | var
|
---|
412 | tmpResult : Boolean;
|
---|
413 | tmpResultFilename : String;
|
---|
414 | begin
|
---|
415 | tmpResult := SearchPath('BUECHER', 'RBRi.INF', tmpResultFilename);
|
---|
416 |
|
---|
417 | assertFalse('testSearchPath_NotExistingEnvironment', tmpResult);
|
---|
418 | assertEqualsString('testSearchPath_NotExistingEnvironment', '', tmpResultFilename);
|
---|
419 | end;
|
---|
420 |
|
---|
421 | // ----------------------------------------------------------
|
---|
422 |
|
---|
423 | Procedure testSearchHelpPaths_FoundBookshelf;
|
---|
424 | var
|
---|
425 | tmpResult : Boolean;
|
---|
426 | tmpResultFilename : String;
|
---|
427 | begin
|
---|
428 | tmpResult := SearchHelpPaths('CMDREF.INF', tmpResultFilename, false);
|
---|
429 |
|
---|
430 | assertTrue('testSearchHelpPaths_FoundBookshelf', tmpResult);
|
---|
431 | assertEqualsString('testSearchHelpPaths_FoundBookshelf', 'C:\OS2\BOOK\CMDREF.INF', tmpResultFilename);
|
---|
432 | end;
|
---|
433 |
|
---|
434 |
|
---|
435 | Procedure testSearchHelpPaths_FoundHelp;
|
---|
436 | var
|
---|
437 | tmpResult : Boolean;
|
---|
438 | tmpResultFilename : String;
|
---|
439 | begin
|
---|
440 | tmpResult := SearchHelpPaths('WPHELP.HLP', tmpResultFilename, false);
|
---|
441 |
|
---|
442 | assertTrue('testSearchHelpPaths_FoundHelp', tmpResult);
|
---|
443 | assertEqualsString('testSearchHelpPaths_FoundHelp', 'C:\OS2\HELP\WPHELP.HLP', tmpResultFilename);
|
---|
444 | end;
|
---|
445 |
|
---|
446 | { . is part of the helppath
|
---|
447 | Procedure testSearchHelpPaths_DontSearchInAppDir;
|
---|
448 | var
|
---|
449 | tmpResult : Boolean;
|
---|
450 | tmpResultFilename : String;
|
---|
451 | begin
|
---|
452 | tmpResult := SearchHelpPaths('NewViewTests.EXE', tmpResultFilename, False);
|
---|
453 |
|
---|
454 | assertFalse('testSearchHelpPaths_DontSearchInAppDir', tmpResult);
|
---|
455 | assertEqualsString('testSearchHelpPaths_DontSearchInAppDir', '', tmpResultFilename);
|
---|
456 | end;
|
---|
457 | }
|
---|
458 |
|
---|
459 | Procedure testSearchHelpPaths_FoundInAppDir;
|
---|
460 | var
|
---|
461 | tmpResult : Boolean;
|
---|
462 | tmpResultFilename : String;
|
---|
463 | begin
|
---|
464 | tmpResult := SearchHelpPaths('NewViewTests.EXE', tmpResultFilename, True);
|
---|
465 |
|
---|
466 | assertTrue('testSearchHelpPaths_FoundInAppDir', tmpResult);
|
---|
467 | assertEqualsString('testSearchHelpPaths_FoundInAppDir', TEST_PATH + '\build\unittest\NewViewTests.EXE', tmpResultFilename);
|
---|
468 | end;
|
---|
469 |
|
---|
470 |
|
---|
471 | Procedure testSearchHelpPaths_NotFoundInAppDir;
|
---|
472 | var
|
---|
473 | tmpResult : Boolean;
|
---|
474 | tmpResultFilename : String;
|
---|
475 | begin
|
---|
476 | tmpResult := SearchHelpPaths('NewView.EXE', tmpResultFilename, True);
|
---|
477 |
|
---|
478 | assertFalse('testSearchHelpPaths_NotFoundInAppDir', tmpResult);
|
---|
479 | assertEqualsString('testSearchHelpPaths_NotFoundInAppDir', '', tmpResultFilename);
|
---|
480 | end;
|
---|
481 |
|
---|
482 | // ----------------------------------------------------------
|
---|
483 |
|
---|
484 | Procedure testFindDefaultLanguageHelpFile;
|
---|
485 | var
|
---|
486 | tmpResult : String;
|
---|
487 | begin
|
---|
488 | tmpResult := FindDefaultLanguageHelpFile('NewView', '');
|
---|
489 |
|
---|
490 | assertEqualsString('testFindDefaultLanguageHelpFile', 'C:\ecs\help\NewView.hlp', tmpResult);
|
---|
491 | end;
|
---|
492 |
|
---|
493 | Procedure testFindDefaultLanguageHelpFile_it;
|
---|
494 | var
|
---|
495 | tmpResult : String;
|
---|
496 | begin
|
---|
497 | tmpResult := FindDefaultLanguageHelpFile('NewView', 'it');
|
---|
498 |
|
---|
499 | assertEqualsString('testFindDefaultLanguageHelpFile_it', 'C:\ecs\help\NewView_it.hlp', tmpResult);
|
---|
500 | end;
|
---|
501 |
|
---|
502 | Procedure testFindDefaultLanguageHelpFile_it_UpperCase;
|
---|
503 | var
|
---|
504 | tmpResult : String;
|
---|
505 | begin
|
---|
506 | tmpResult := FindDefaultLanguageHelpFile('NewView', 'IT');
|
---|
507 |
|
---|
508 | assertEqualsString('testFindDefaultLanguageHelpFile_it_UpperCase', 'C:\ecs\help\NewView_IT.hlp', tmpResult);
|
---|
509 | end;
|
---|
510 |
|
---|
511 |
|
---|
512 | // ----------------------------------------------------------
|
---|
513 |
|
---|
514 |
|
---|
515 | Procedure testGetDirsInPath_Unknown;
|
---|
516 | var
|
---|
517 | tmpResult : TStringList;
|
---|
518 | begin
|
---|
519 | tmpResult := TStringList.Create;
|
---|
520 | tmpResult.Add('Tester');
|
---|
521 |
|
---|
522 | GetDirsInPath('Unknown', tmpResult);
|
---|
523 |
|
---|
524 | assertEqualsInt('testGetDirsInPath_Unknown', 0, tmpResult.count);
|
---|
525 |
|
---|
526 | tmpResult.Destroy;
|
---|
527 | end;
|
---|
528 |
|
---|
529 |
|
---|
530 | Procedure testGetDirsInPath_Help;
|
---|
531 | var
|
---|
532 | tmpResult : TStringList;
|
---|
533 | begin
|
---|
534 | tmpResult := TStringList.Create;
|
---|
535 | tmpResult.Add('Tester');
|
---|
536 |
|
---|
537 | GetDirsInPath('HELP', tmpResult);
|
---|
538 |
|
---|
539 | assertEqualsInt('testGetDirsInPath_Help', 8, tmpResult.count);
|
---|
540 | assertEqualsString('testGetDirsInPath_Help', 'D:\progs\develop\watcom_18\BINP\HELP', tmpResult[0]);
|
---|
541 | assertEqualsString('testGetDirsInPath_Help', 'C:\MMOS2\HELP', tmpResult[7]);
|
---|
542 |
|
---|
543 | tmpResult.Destroy;
|
---|
544 | end;
|
---|
545 |
|
---|
546 | // ----------------------------------------------------------
|
---|
547 |
|
---|
548 | Procedure testListFilesInDirectory_NoFiles;
|
---|
549 | var
|
---|
550 | tmpResult : TStringList;
|
---|
551 | begin
|
---|
552 | tmpResult := TStringList.Create;
|
---|
553 |
|
---|
554 | ListFilesInDirectory(TEST_PATH + '\unittests\testdir', '*.jonas', false, tmpResult);
|
---|
555 |
|
---|
556 | assertEqualsInt('testListFilesInDirectory_NoFiles', 0, tmpResult.count);
|
---|
557 | end;
|
---|
558 |
|
---|
559 |
|
---|
560 | Procedure testListFilesInDirectory_EmptyFilter;
|
---|
561 | var
|
---|
562 | tmpResult : TStringList;
|
---|
563 | begin
|
---|
564 | tmpResult := TStringList.Create;
|
---|
565 |
|
---|
566 | ListFilesInDirectory(TEST_PATH + '\unittests\testdir', '', false, tmpResult);
|
---|
567 |
|
---|
568 | assertEqualsInt('testListFilesInDirectory_EmptyFilter', 0, tmpResult.count);
|
---|
569 |
|
---|
570 | tmpResult.Destroy;
|
---|
571 | end;
|
---|
572 |
|
---|
573 |
|
---|
574 | Procedure testListFilesInDirectory_OneFile;
|
---|
575 | var
|
---|
576 | tmpResult : TStringList;
|
---|
577 | begin
|
---|
578 | tmpResult := TStringList.Create;
|
---|
579 |
|
---|
580 | ListFilesInDirectory(TEST_PATH + '\unittests\testdir', '*.txt', false, tmpResult);
|
---|
581 |
|
---|
582 | assertEqualsInt('testListFilesInDirectory_OneFile', 1, tmpResult.count);
|
---|
583 | assertEqualsString('testListFilesInDirectory_OneFile', 'readme.txt', tmpResult[0]);
|
---|
584 |
|
---|
585 | tmpResult.Destroy;
|
---|
586 | end;
|
---|
587 |
|
---|
588 |
|
---|
589 | Procedure testListFilesInDirectory_ManyFiles;
|
---|
590 | var
|
---|
591 | tmpResult : TStringList;
|
---|
592 | begin
|
---|
593 | tmpResult := TStringList.Create;
|
---|
594 |
|
---|
595 | ListFilesInDirectory(TEST_PATH + '\unittests\testdir', '*.*', false, tmpResult);
|
---|
596 |
|
---|
597 | assertEqualsInt('testListFilesInDirectory_ManyFiles', 6, tmpResult.count);
|
---|
598 | assertEqualsString('testListFilesInDirectory_ManyFiles', 'file0', tmpResult[0]);
|
---|
599 | assertEqualsString('testListFilesInDirectory_ManyFiles', 'file1.ex1', tmpResult[1]);
|
---|
600 | assertEqualsString('testListFilesInDirectory_ManyFiles', 'file2.ex1', tmpResult[2]);
|
---|
601 | assertEqualsString('testListFilesInDirectory_ManyFiles', 'file3.ex3', tmpResult[3]);
|
---|
602 | assertEqualsString('testListFilesInDirectory_ManyFiles', 'file4.ext4', tmpResult[4]);
|
---|
603 |
|
---|
604 | tmpResult.Destroy;
|
---|
605 | end;
|
---|
606 |
|
---|
607 |
|
---|
608 | Procedure testListFilesInDirectory_ManyFilter;
|
---|
609 | var
|
---|
610 | tmpResult : TStringList;
|
---|
611 | begin
|
---|
612 | tmpResult := TStringList.Create;
|
---|
613 |
|
---|
614 | ListFilesInDirectory(TEST_PATH + '\unittests\testdir', '*.txt;f*.ex1', false, tmpResult);
|
---|
615 |
|
---|
616 | assertEqualsInt('testListFilesInDirectory_ManyFilter', 3, tmpResult.count);
|
---|
617 | assertEqualsString('testListFilesInDirectory_ManyFilter', 'readme.txt', tmpResult[0]);
|
---|
618 | assertEqualsString('testListFilesInDirectory_ManyFiles', 'file1.ex1', tmpResult[1]);
|
---|
619 | assertEqualsString('testListFilesInDirectory_ManyFiles', 'file2.ex1', tmpResult[2]);
|
---|
620 |
|
---|
621 | tmpResult.Destroy;
|
---|
622 | end;
|
---|
623 |
|
---|
624 |
|
---|
625 | // ----------------------------------------------------------
|
---|
626 |
|
---|
627 |
|
---|
628 | Procedure testListFilesInDirectoryWithDirectoryInResult_NoFiles;
|
---|
629 | var
|
---|
630 | tmpResult : TStringList;
|
---|
631 | begin
|
---|
632 | tmpResult := TStringList.Create;
|
---|
633 |
|
---|
634 | ListFilesInDirectory(TEST_PATH + '\unittests\testdir', '*.jonas', true, tmpResult);
|
---|
635 |
|
---|
636 | assertEqualsInt('testListFilesInDirectoryWithDirectoryInResult_NoFiles', 0, tmpResult.count);
|
---|
637 | end;
|
---|
638 |
|
---|
639 |
|
---|
640 | Procedure testListFilesInDirectoryWithDirectoryInResult_EmptyFilter;
|
---|
641 | var
|
---|
642 | tmpResult : TStringList;
|
---|
643 | begin
|
---|
644 | tmpResult := TStringList.Create;
|
---|
645 |
|
---|
646 | ListFilesInDirectory(TEST_PATH + '\unittests\testdir', '', true, tmpResult);
|
---|
647 |
|
---|
648 | assertEqualsInt('testListFilesInDirectoryWithDirectoryInResult_EmptyFilter', 0, tmpResult.count);
|
---|
649 |
|
---|
650 | tmpResult.Destroy;
|
---|
651 | end;
|
---|
652 |
|
---|
653 |
|
---|
654 | Procedure testListFilesInDirectoryWithDirectoryInResult_OneFile;
|
---|
655 | var
|
---|
656 | tmpResult : TStringList;
|
---|
657 | begin
|
---|
658 | tmpResult := TStringList.Create;
|
---|
659 |
|
---|
660 | ListFilesInDirectory(TEST_PATH + '\unittests\testdir', '*.txt', true, tmpResult);
|
---|
661 |
|
---|
662 | assertEqualsInt('testListFilesInDirectoryWithDirectoryInResult_OneFile', 1, tmpResult.count);
|
---|
663 | assertEqualsString('testListFilesInDirectoryWithDirectoryInResult_OneFile', TEST_PATH + '\unittests\testdir' + '\readme.txt', tmpResult[0]);
|
---|
664 |
|
---|
665 | tmpResult.Destroy;
|
---|
666 | end;
|
---|
667 |
|
---|
668 |
|
---|
669 | Procedure testListFilesInDirectoryWithDirectoryInResult_ManyFiles;
|
---|
670 | var
|
---|
671 | tmpResult : TStringList;
|
---|
672 | begin
|
---|
673 | tmpResult := TStringList.Create;
|
---|
674 |
|
---|
675 | ListFilesInDirectory(TEST_PATH + '\unittests\testdir', '*.*', true, tmpResult);
|
---|
676 |
|
---|
677 | assertEqualsInt('testListFilesInDirectoryWithDirectoryInResult_ManyFiles', 6, tmpResult.count);
|
---|
678 | assertEqualsString('testListFilesInDirectoryWithDirectoryInResult_ManyFiles', TEST_PATH + '\unittests\testdir' + '\file0', tmpResult[0]);
|
---|
679 | assertEqualsString('testListFilesInDirectoryWithDirectoryInResult_ManyFiles', TEST_PATH + '\unittests\testdir' + '\file1.ex1', tmpResult[1]);
|
---|
680 | assertEqualsString('testListFilesInDirectoryWithDirectoryInResult_ManyFiles', TEST_PATH + '\unittests\testdir' + '\file2.ex1', tmpResult[2]);
|
---|
681 | assertEqualsString('testListFilesInDirectoryWithDirectoryInResult_ManyFiles', TEST_PATH + '\unittests\testdir' + '\file3.ex3', tmpResult[3]);
|
---|
682 | assertEqualsString('testListFilesInDirectoryWithDirectoryInResult_ManyFiles', TEST_PATH + '\unittests\testdir' + '\file4.ext4', tmpResult[4]);
|
---|
683 | assertEqualsString('testListFilesInDirectoryWithDirectoryInResult_ManyFiles', TEST_PATH + '\unittests\testdir' + '\readme.txt', tmpResult[5]);
|
---|
684 |
|
---|
685 | tmpResult.Destroy;
|
---|
686 | end;
|
---|
687 |
|
---|
688 |
|
---|
689 | Procedure testListFilesInDirectoryWithDirectoryInResult_ManyFilter;
|
---|
690 | var
|
---|
691 | tmpResult : TStringList;
|
---|
692 | begin
|
---|
693 | tmpResult := TStringList.Create;
|
---|
694 |
|
---|
695 | ListFilesInDirectory(TEST_PATH + '\unittests\testdir', '*.txt;f*.ex1', true, tmpResult);
|
---|
696 |
|
---|
697 | assertEqualsInt('testListFilesInDirectoryWithDirectoryInResult_ManyFilter', 3, tmpResult.count);
|
---|
698 | assertEqualsString('testListFilesInDirectoryWithDirectoryInResult_ManyFilter', TEST_PATH + '\unittests\testdir' + '\readme.txt', tmpResult[0]);
|
---|
699 | assertEqualsString('testListFilesInDirectoryWithDirectoryInResult_ManyFilter', TEST_PATH + '\unittests\testdir' + '\file1.ex1', tmpResult[1]);
|
---|
700 | assertEqualsString('testListFilesInDirectoryWithDirectoryInResult_ManyFilter', TEST_PATH + '\unittests\testdir' + '\file2.ex1', tmpResult[2]);
|
---|
701 |
|
---|
702 | tmpResult.Destroy;
|
---|
703 | end;
|
---|
704 |
|
---|
705 | // ----------------------------------------------------------
|
---|
706 |
|
---|
707 | Procedure testListSubDirectories_None;
|
---|
708 | var
|
---|
709 | tmpResult : TStringList;
|
---|
710 | begin
|
---|
711 | tmpResult := TStringList.Create;
|
---|
712 |
|
---|
713 | ListSubDirectories(TEST_PATH + '\unittests\testdir\subdir1', false, tmpResult);
|
---|
714 |
|
---|
715 | assertEqualsInt('testListSubDirectories_None', 0, tmpResult.count);
|
---|
716 |
|
---|
717 | tmpResult.Destroy;
|
---|
718 | end;
|
---|
719 |
|
---|
720 |
|
---|
721 | Procedure testListSubDirectories_NoneWithHidden;
|
---|
722 | var
|
---|
723 | tmpResult : TStringList;
|
---|
724 | begin
|
---|
725 | tmpResult := TStringList.Create;
|
---|
726 |
|
---|
727 | ListSubDirectories(TEST_PATH + '\unittests\testdir\subdir1', true, tmpResult);
|
---|
728 |
|
---|
729 | assertEqualsInt('testListSubDirectories_NoneWithHidden', 1, tmpResult.count);
|
---|
730 | assertEqualsString('testListSubDirectories_NoneWithHidden', TEST_PATH + '\unittests\testdir\subdir1\.svn', tmpResult[0]);
|
---|
731 |
|
---|
732 | tmpResult.Destroy;
|
---|
733 | end;
|
---|
734 |
|
---|
735 |
|
---|
736 | Procedure testListSubDirectories_Many;
|
---|
737 | var
|
---|
738 | tmpResult : TStringList;
|
---|
739 | begin
|
---|
740 | tmpResult := TStringList.Create;
|
---|
741 |
|
---|
742 | ListSubDirectories(TEST_PATH + '\unittests\testdir', false, tmpResult);
|
---|
743 |
|
---|
744 | assertEqualsInt('testListSubDirectories_Many', 3, tmpResult.count);
|
---|
745 | assertEqualsString('testListSubDirectories_Many', TEST_PATH + '\unittests\testdir\dir_archived', tmpResult[0]);
|
---|
746 | assertEqualsString('testListSubDirectories_Many', TEST_PATH + '\unittests\testdir\dir_readonly', tmpResult[1]);
|
---|
747 | assertEqualsString('testListSubDirectories_Many', TEST_PATH + '\unittests\testdir\subdir1', tmpResult[2]);
|
---|
748 |
|
---|
749 | tmpResult.Destroy;
|
---|
750 | end;
|
---|
751 |
|
---|
752 |
|
---|
753 | Procedure testListSubDirectories_ManyWithHidden;
|
---|
754 | var
|
---|
755 | tmpResult : TStringList;
|
---|
756 | begin
|
---|
757 | tmpResult := TStringList.Create;
|
---|
758 |
|
---|
759 | ListSubDirectories(TEST_PATH + '\unittests\testdir', true, tmpResult);
|
---|
760 |
|
---|
761 | assertEqualsInt('testListSubDirectories_ManyWithHidden', 6, tmpResult.count);
|
---|
762 | assertEqualsString('testListSubDirectories_ManyWithHidden', TEST_PATH + '\unittests\testdir\.svn', tmpResult[0]);
|
---|
763 | assertEqualsString('testListSubDirectories_ManyWithHidden', TEST_PATH + '\unittests\testdir\dir_archived', tmpResult[1]);
|
---|
764 | assertEqualsString('testListSubDirectories_ManyWithHidden', TEST_PATH + '\unittests\testdir\dir_hidden', tmpResult[2]);
|
---|
765 | assertEqualsString('testListSubDirectories_ManyWithHidden', TEST_PATH + '\unittests\testdir\dir_readonly', tmpResult[3]);
|
---|
766 | assertEqualsString('testListSubDirectories_ManyWithHidden', TEST_PATH + '\unittests\testdir\dir_system', tmpResult[4]);
|
---|
767 | assertEqualsString('testListSubDirectories_ManyWithHidden', TEST_PATH + '\unittests\testdir\subdir1', tmpResult[5]);
|
---|
768 |
|
---|
769 | tmpResult.Destroy;
|
---|
770 | end;
|
---|
771 |
|
---|
772 |
|
---|
773 | // ----------------------------------------------------------
|
---|
774 |
|
---|
775 |
|
---|
776 | Procedure testListFilesInDirectoryRecursiveWithTermination;
|
---|
777 | var
|
---|
778 | tmpResult : TStringList;
|
---|
779 | begin
|
---|
780 | tmpResult := TStringList.Create;
|
---|
781 |
|
---|
782 | ListFilesInDirectoryRecursiveWithTermination(TEST_PATH + '\unittests\testdir', '*.ex1;ex2;file_in_*', false, false, tmpResult, nil, false);
|
---|
783 |
|
---|
784 | assertEqualsInt('testListFilesInDirectoryRecursiveWithTermination', 5, tmpResult.count);
|
---|
785 | assertEqualsString('testListFilesInDirectoryRecursiveWithTermination 0', 'file1.ex1', tmpResult[0]);
|
---|
786 | assertEqualsString('testListFilesInDirectoryRecursiveWithTermination 1', 'file2.ex1', tmpResult[1]);
|
---|
787 | assertEqualsString('testListFilesInDirectoryRecursiveWithTermination 2', 'file_in_archived', tmpResult[2]);
|
---|
788 | assertEqualsString('testListFilesInDirectoryRecursiveWithTermination 3', 'file_in_readonly', tmpResult[3]);
|
---|
789 | assertEqualsString('testListFilesInDirectoryRecursiveWithTermination 4', 'file1.ex1', tmpResult[4]);
|
---|
790 |
|
---|
791 | tmpResult.Destroy;
|
---|
792 | end;
|
---|
793 |
|
---|
794 |
|
---|
795 | Procedure testListFilesInDirectoryRecursiveWithTermination_WithHidden;
|
---|
796 | var
|
---|
797 | tmpResult : TStringList;
|
---|
798 | begin
|
---|
799 | tmpResult := TStringList.Create;
|
---|
800 |
|
---|
801 | ListFilesInDirectoryRecursiveWithTermination(TEST_PATH + '\unittests\testdir', '*.ex1;ex2;file_in_*', false, true, tmpResult, nil, false);
|
---|
802 |
|
---|
803 | assertEqualsInt('testListFilesInDirectoryRecursiveWithTermination_WithHidden', 15, tmpResult.count);
|
---|
804 | assertEqualsString('testListFilesInDirectoryRecursiveWithTermination_WithHidden 0', 'file1.ex1', tmpResult[0]);
|
---|
805 | assertEqualsString('testListFilesInDirectoryRecursiveWithTermination_WithHidden 1', 'file2.ex1', tmpResult[1]);
|
---|
806 | assertEqualsString('testListFilesInDirectoryRecursiveWithTermination_WithHidden 2', 'file_in_archived', tmpResult[2]);
|
---|
807 | assertEqualsString('testListFilesInDirectoryRecursiveWithTermination_WithHidden 3', 'file_in_archived.svn-base', tmpResult[3]);
|
---|
808 | assertEqualsString('testListFilesInDirectoryRecursiveWithTermination_WithHidden 4', 'file_in_archived.svn-base', tmpResult[4]);
|
---|
809 | assertEqualsString('testListFilesInDirectoryRecursiveWithTermination_WithHidden 5', 'file_in_hidden', tmpResult[5]);
|
---|
810 | assertEqualsString('testListFilesInDirectoryRecursiveWithTermination_WithHidden 6', 'file_in_hidden.svn-base', tmpResult[6]);
|
---|
811 | assertEqualsString('testListFilesInDirectoryRecursiveWithTermination_WithHidden 7', 'file_in_hidden.svn-base', tmpResult[7]);
|
---|
812 | assertEqualsString('testListFilesInDirectoryRecursiveWithTermination_WithHidden 8', 'file_in_readonly', tmpResult[8]);
|
---|
813 | assertEqualsString('testListFilesInDirectoryRecursiveWithTermination_WithHidden 9', 'file_in_readonly.svn-base', tmpResult[9]);
|
---|
814 | assertEqualsString('testListFilesInDirectoryRecursiveWithTermination_WithHidden 10', 'file_in_readonly.svn-base', tmpResult[10]);
|
---|
815 | assertEqualsString('testListFilesInDirectoryRecursiveWithTermination_WithHidden 11', 'file_in_system', tmpResult[11]);
|
---|
816 | assertEqualsString('testListFilesInDirectoryRecursiveWithTermination_WithHidden 12', 'file_in_system.svn-base', tmpResult[12]);
|
---|
817 | assertEqualsString('testListFilesInDirectoryRecursiveWithTermination_WithHidden 13', 'file_in_system.svn-base', tmpResult[13]);
|
---|
818 | assertEqualsString('testListFilesInDirectoryRecursiveWithTermination_WithHidden 14', 'file1.ex1', tmpResult[14]);
|
---|
819 |
|
---|
820 | tmpResult.Destroy;
|
---|
821 | end;
|
---|
822 |
|
---|
823 |
|
---|
824 | Procedure testListFilesInDirectoryRecursiveWithTermination_WithDirAndHidden;
|
---|
825 | var
|
---|
826 | tmpResult : TStringList;
|
---|
827 | begin
|
---|
828 | tmpResult := TStringList.Create;
|
---|
829 |
|
---|
830 | ListFilesInDirectoryRecursiveWithTermination(TEST_PATH + '\unittests\testdir', '*.ex1;ex2;file_in_*', true, true, tmpResult, nil, false);
|
---|
831 |
|
---|
832 | assertEqualsInt('testListFilesInDirectoryRecursiveWithTermination_WithDirAndHidden', 15, tmpResult.count);
|
---|
833 | assertEqualsString('testListFilesInDirectoryRecursiveWithTermination_WithDirAndHidden 0', TEST_PATH + '\unittests\testdir\' + 'file1.ex1', tmpResult[0]);
|
---|
834 | assertEqualsString('testListFilesInDirectoryRecursiveWithTermination_WithDirAndHidden 1', TEST_PATH + '\unittests\testdir\' + 'file2.ex1', tmpResult[1]);
|
---|
835 | assertEqualsString('testListFilesInDirectoryRecursiveWithTermination_WithDirAndHidden 2', TEST_PATH + '\unittests\testdir\dir_archived\' + 'file_in_archived', tmpResult[2]);
|
---|
836 | assertEqualsString('testListFilesInDirectoryRecursiveWithTermination_WithDirAndHidden 3', TEST_PATH + '\unittests\testdir\dir_archived\.svn\prop-base\' + 'file_in_archived.svn-base', tmpResult[3]);
|
---|
837 | assertEqualsString('testListFilesInDirectoryRecursiveWithTermination_WithDirAndHidden 4', TEST_PATH + '\unittests\testdir\dir_archived\.svn\text-base\' + 'file_in_archived.svn-base', tmpResult[4]);
|
---|
838 | assertEqualsString('testListFilesInDirectoryRecursiveWithTermination_WithDirAndHidden 5', TEST_PATH + '\unittests\testdir\dir_hidden\' + 'file_in_hidden', tmpResult[5]);
|
---|
839 | assertEqualsString('testListFilesInDirectoryRecursiveWithTermination_WithDirAndHidden 6', TEST_PATH + '\unittests\testdir\dir_hidden\.svn\prop-base\' + 'file_in_hidden.svn-base', tmpResult[6]);
|
---|
840 | assertEqualsString('testListFilesInDirectoryRecursiveWithTermination_WithDirAndHidden 7', TEST_PATH + '\unittests\testdir\dir_hidden\.svn\text-base\' + 'file_in_hidden.svn-base', tmpResult[7]);
|
---|
841 | assertEqualsString('testListFilesInDirectoryRecursiveWithTermination_WithDirAndHidden 8', TEST_PATH + '\unittests\testdir\dir_readonly\' + 'file_in_readonly', tmpResult[8]);
|
---|
842 | assertEqualsString('testListFilesInDirectoryRecursiveWithTermination_WithDirAndHidden 9', TEST_PATH + '\unittests\testdir\dir_readonly\.svn\prop-base\' + 'file_in_readonly.svn-base', tmpResult[9]);
|
---|
843 | assertEqualsString('testListFilesInDirectoryRecursiveWithTermination_WithDirAndHidden 10', TEST_PATH + '\unittests\testdir\dir_readonly\.svn\text-base\' + 'file_in_readonly.svn-base', tmpResult[10]);
|
---|
844 | assertEqualsString('testListFilesInDirectoryRecursiveWithTermination_WithDirAndHidden 11', TEST_PATH + '\unittests\testdir\dir_system\' + 'file_in_system', tmpResult[11]);
|
---|
845 | assertEqualsString('testListFilesInDirectoryRecursiveWithTermination_WithDirAndHidden 12', TEST_PATH + '\unittests\testdir\dir_system\.svn\prop-base\' + 'file_in_system.svn-base', tmpResult[12]);
|
---|
846 | assertEqualsString('testListFilesInDirectoryRecursiveWithTermination_WithDirAndHidden 13', TEST_PATH + '\unittests\testdir\dir_system\.svn\text-base\' + 'file_in_system.svn-base', tmpResult[13]);
|
---|
847 | assertEqualsString('testListFilesInDirectoryRecursiveWithTermination_WithDirAndHidden 14', TEST_PATH + '\unittests\testdir\subdir1\' + 'file1.ex1', tmpResult[14]);
|
---|
848 |
|
---|
849 | tmpResult.Destroy;
|
---|
850 | end;
|
---|
851 |
|
---|
852 |
|
---|
853 | Procedure testListFilesInDirectoryRecursiveWithTermination_WithDirectoryInResult;
|
---|
854 | var
|
---|
855 | tmpResult : TStringList;
|
---|
856 | begin
|
---|
857 | tmpResult := TStringList.Create;
|
---|
858 |
|
---|
859 | ListFilesInDirectoryRecursiveWithTermination(TEST_PATH + '\unittests\testdir', '*.ex1;ex2', true, false, tmpResult, nil, false);
|
---|
860 |
|
---|
861 | assertEqualsInt('testListFilesInDirectoryRecursiveWithTerminationWithDirectoryInResult', 3, tmpResult.count);
|
---|
862 | assertEqualsString('testListFilesInDirectoryRecursiveWithTerminationWithDirectoryInResult', TEST_PATH + '\unittests\testdir' + '\file1.ex1', tmpResult[0]);
|
---|
863 | assertEqualsString('testListFilesInDirectoryRecursiveWithTerminationWithDirectoryInResult', TEST_PATH + '\unittests\testdir' + '\file2.ex1', tmpResult[1]);
|
---|
864 | assertEqualsString('testListFilesInDirectoryRecursiveWithTerminationWithDirectoryInResult', TEST_PATH + '\unittests\testdir' + '\subdir1\file1.ex1', tmpResult[2]);
|
---|
865 |
|
---|
866 | tmpResult.Destroy;
|
---|
867 | end;
|
---|
868 |
|
---|
869 |
|
---|
870 | Procedure testListFilesInDirectoryRecursiveWithTermination_1WithDirectoryInResultWithHidden;
|
---|
871 | var
|
---|
872 | tmpResult : TStringList;
|
---|
873 | begin
|
---|
874 | tmpResult := TStringList.Create;
|
---|
875 |
|
---|
876 | ListFilesInDirectoryRecursiveWithTermination(TEST_PATH + '\unittests\testdir', '*.ex1;ex2', true, true, tmpResult, nil, false);
|
---|
877 |
|
---|
878 | assertEqualsInt('testListFilesInDirectoryRecursiveWithTerminationWithDirectoryInResultWithHidden', 3, tmpResult.count);
|
---|
879 | assertEqualsString('testListFilesInDirectoryRecursiveWithTerminationWithDirectoryInResultWithHidden', TEST_PATH + '\unittests\testdir' + '\file1.ex1', tmpResult[0]);
|
---|
880 | assertEqualsString('testListFilesInDirectoryRecursiveWithTerminationWithDirectoryInResultWithHidden', TEST_PATH + '\unittests\testdir' + '\file2.ex1', tmpResult[1]);
|
---|
881 | assertEqualsString('testListFilesInDirectoryRecursiveWithTerminationWithDirectoryInResultWithHidden', TEST_PATH + '\unittests\testdir' + '\subdir1\file1.ex1', tmpResult[2]);
|
---|
882 |
|
---|
883 | tmpResult.Destroy;
|
---|
884 | end;
|
---|
885 |
|
---|
886 |
|
---|
887 | // ----------------------------------------------------------
|
---|
888 |
|
---|
889 |
|
---|
890 | Procedure testParentDir_Empty;
|
---|
891 | var
|
---|
892 | tmpResult : String;
|
---|
893 | begin
|
---|
894 | tmpResult := ParentDir('');
|
---|
895 |
|
---|
896 | assertEqualsString('testParentDir_Empty', '', tmpResult);
|
---|
897 | end;
|
---|
898 |
|
---|
899 |
|
---|
900 | Procedure testParentDir_Root;
|
---|
901 | var
|
---|
902 | tmpResult : String;
|
---|
903 | begin
|
---|
904 | tmpResult := ParentDir('C:\');
|
---|
905 |
|
---|
906 | assertEqualsString('testParentDir_Root', '', tmpResult);
|
---|
907 | end;
|
---|
908 |
|
---|
909 |
|
---|
910 | Procedure testParentDir_UnixRoot;
|
---|
911 | var
|
---|
912 | tmpResult : String;
|
---|
913 | begin
|
---|
914 | tmpResult := ParentDir('\');
|
---|
915 |
|
---|
916 | assertEqualsString('testParentDir_UnixRoot', '', tmpResult);
|
---|
917 | end;
|
---|
918 |
|
---|
919 |
|
---|
920 | Procedure testParentDir;
|
---|
921 | var
|
---|
922 | tmpResult : String;
|
---|
923 | begin
|
---|
924 | tmpResult := ParentDir('\abc\def');
|
---|
925 |
|
---|
926 | assertEqualsString('testParentDir', '\abc', tmpResult);
|
---|
927 | end;
|
---|
928 |
|
---|
929 |
|
---|
930 | Procedure testParentDir_OnlyOne;
|
---|
931 | var
|
---|
932 | tmpResult : String;
|
---|
933 | begin
|
---|
934 | tmpResult := ParentDir('\abc');
|
---|
935 |
|
---|
936 | assertEqualsString('testParentDir_OnlyOne', '', tmpResult);
|
---|
937 | end;
|
---|
938 |
|
---|
939 |
|
---|
940 | Procedure testParentDir_SlashAtEnd;
|
---|
941 | var
|
---|
942 | tmpResult : String;
|
---|
943 | begin
|
---|
944 | tmpResult := ParentDir('\abc\def\');
|
---|
945 |
|
---|
946 | assertEqualsString('testParentDir_SlashAtEnd', '\abc', tmpResult);
|
---|
947 | end;
|
---|
948 |
|
---|
949 |
|
---|
950 | Procedure testParentDir_NoSlashAtStart;
|
---|
951 | var
|
---|
952 | tmpResult : String;
|
---|
953 | begin
|
---|
954 | tmpResult := ParentDir('abc\def\');
|
---|
955 |
|
---|
956 | assertEqualsString('testParentDir_NoSlashAtStart', 'abc', tmpResult);
|
---|
957 | end;
|
---|
958 |
|
---|
959 |
|
---|
960 | Procedure testParentDir_NoSlash;
|
---|
961 | var
|
---|
962 | tmpResult : String;
|
---|
963 | begin
|
---|
964 | tmpResult := ParentDir('abc');
|
---|
965 |
|
---|
966 | assertEqualsString('testParentDir_NoSlash', '', tmpResult);
|
---|
967 | end;
|
---|
968 |
|
---|
969 |
|
---|
970 | Procedure testParentDir_GoToRootDrive;
|
---|
971 | var
|
---|
972 | tmpResult : String;
|
---|
973 | begin
|
---|
974 | tmpResult := ParentDir('c:\abc');
|
---|
975 |
|
---|
976 | assertEqualsString('testParentDir_GoToRootDrive', 'c:', tmpResult);
|
---|
977 | end;
|
---|
978 |
|
---|
979 |
|
---|
980 | // ----------------------------------------------------------
|
---|
981 |
|
---|
982 |
|
---|
983 | Procedure testMakeDirs_Empty;
|
---|
984 | var
|
---|
985 | tmpResult : String;
|
---|
986 | begin
|
---|
987 | tmpResult := MakeDirs('');
|
---|
988 |
|
---|
989 | assertEqualsString('testMakeDirs_Empty', '', tmpResult);
|
---|
990 | end;
|
---|
991 |
|
---|
992 |
|
---|
993 | Procedure testMakeDirs_Slash;
|
---|
994 | var
|
---|
995 | tmpResult : String;
|
---|
996 | begin
|
---|
997 | tmpResult := MakeDirs('\');
|
---|
998 |
|
---|
999 | assertEqualsString('testMakeDirs_Slash', '', tmpResult);
|
---|
1000 | end;
|
---|
1001 |
|
---|
1002 |
|
---|
1003 | Procedure testMakeDirs_Simple;
|
---|
1004 | var
|
---|
1005 | tmpResult : String;
|
---|
1006 | begin
|
---|
1007 | RmDir(TEST_PATH + '\unittests\testdir\makedirs');
|
---|
1008 |
|
---|
1009 | tmpResult := MakeDirs(TEST_PATH + '\unittests\testdir' + '\makedirs');
|
---|
1010 |
|
---|
1011 | RmDir(TEST_PATH + '\unittests\testdir\makedirs');
|
---|
1012 |
|
---|
1013 | assertEqualsString('testMakeDirs_Simple', TEST_PATH + '\unittests\testdir\makedirs', tmpResult);
|
---|
1014 | end;
|
---|
1015 |
|
---|
1016 |
|
---|
1017 | Procedure testMakeDirs_Complex;
|
---|
1018 | var
|
---|
1019 | tmpResult : String;
|
---|
1020 | begin
|
---|
1021 | RmDir(TEST_PATH + '\unittests\testdir\makedirs\subdir\test');
|
---|
1022 | RmDir(TEST_PATH + '\unittests\testdir\makedirs\subdir');
|
---|
1023 | RmDir(TEST_PATH + '\unittests\testdir\makedirs');
|
---|
1024 |
|
---|
1025 | tmpResult := MakeDirs(TEST_PATH + '\unittests\testdir' + '\makedirs\subdir\test');
|
---|
1026 |
|
---|
1027 | RmDir(TEST_PATH + '\unittests\testdir\makedirs\subdir\test');
|
---|
1028 | RmDir(TEST_PATH + '\unittests\testdir\makedirs\subdir');
|
---|
1029 | RmDir(TEST_PATH + '\unittests\testdir\makedirs');
|
---|
1030 |
|
---|
1031 | assertEqualsString('testMakeDirs_Simple', TEST_PATH + '\unittests\testdir\makedirs\subdir\test', tmpResult);
|
---|
1032 | end;
|
---|
1033 |
|
---|
1034 |
|
---|
1035 | // ----------------------------------------------------------
|
---|
1036 |
|
---|
1037 |
|
---|
1038 | Procedure testDirectoryExists_Empty;
|
---|
1039 | var
|
---|
1040 | tmpResult : Boolean;
|
---|
1041 | begin
|
---|
1042 | tmpResult := DirectoryExists('');
|
---|
1043 |
|
---|
1044 | assertTrue('testDirectoryExists_Empty', tmpResult);
|
---|
1045 | end;
|
---|
1046 |
|
---|
1047 |
|
---|
1048 | Procedure testDirectoryExists_DriveOnlyLowercase;
|
---|
1049 | var
|
---|
1050 | tmpResult : Boolean;
|
---|
1051 | begin
|
---|
1052 | tmpResult := DirectoryExists('c:');
|
---|
1053 |
|
---|
1054 | assertTrue('testDirectoryExists_DriveOnlyLowercase', tmpResult);
|
---|
1055 | end;
|
---|
1056 |
|
---|
1057 |
|
---|
1058 | Procedure testDirectoryExists_DriveOnlyUppercase;
|
---|
1059 | var
|
---|
1060 | tmpResult : Boolean;
|
---|
1061 | begin
|
---|
1062 | tmpResult := DirectoryExists('C:');
|
---|
1063 |
|
---|
1064 | assertTrue('testDirectoryExists_DriveOnlyUppercase', tmpResult);
|
---|
1065 | end;
|
---|
1066 |
|
---|
1067 |
|
---|
1068 | Procedure testDirectoryExists_DriveOnlySlashAtEnd;
|
---|
1069 | var
|
---|
1070 | tmpResult : Boolean;
|
---|
1071 | begin
|
---|
1072 | tmpResult := DirectoryExists('C:\');
|
---|
1073 |
|
---|
1074 | assertTrue('testDirectoryExists_DriveOnlySlashAtEnd', tmpResult);
|
---|
1075 | end;
|
---|
1076 |
|
---|
1077 |
|
---|
1078 | Procedure testDirectoryExists_DriveAndPath;
|
---|
1079 | var
|
---|
1080 | tmpResult : Boolean;
|
---|
1081 | begin
|
---|
1082 | tmpResult := DirectoryExists('C:\os2\bitmap');
|
---|
1083 |
|
---|
1084 | assertTrue('testDirectoryExists_DriveAndPath', tmpResult);
|
---|
1085 | end;
|
---|
1086 |
|
---|
1087 |
|
---|
1088 | Procedure testDirectoryExists_DriveAndPathSlashAtEnd;
|
---|
1089 | var
|
---|
1090 | tmpResult : Boolean;
|
---|
1091 | begin
|
---|
1092 | tmpResult := DirectoryExists('C:\os2\bitmap\');
|
---|
1093 |
|
---|
1094 | assertTrue('testDirectoryExists_DriveAndPathSlashAtEnd', tmpResult);
|
---|
1095 | end;
|
---|
1096 |
|
---|
1097 |
|
---|
1098 | Procedure testDirectoryExists_InvalidDrive;
|
---|
1099 | var
|
---|
1100 | tmpResult : Boolean;
|
---|
1101 | begin
|
---|
1102 | tmpResult := DirectoryExists('y:');
|
---|
1103 |
|
---|
1104 | assertFalse('testDirectoryExists_InvalidDrive', tmpResult);
|
---|
1105 | end;
|
---|
1106 |
|
---|
1107 |
|
---|
1108 | Procedure testDirectoryExists_InvalidDriveAndPath;
|
---|
1109 | var
|
---|
1110 | tmpResult : Boolean;
|
---|
1111 | begin
|
---|
1112 | tmpResult := DirectoryExists('y:\test');
|
---|
1113 |
|
---|
1114 | assertFalse('testDirectoryExists_InvalidDriveAndPath', tmpResult);
|
---|
1115 | end;
|
---|
1116 |
|
---|
1117 |
|
---|
1118 | Procedure testDirectoryExists_NotExistent;
|
---|
1119 | var
|
---|
1120 | tmpResult : Boolean;
|
---|
1121 | begin
|
---|
1122 | tmpResult := DirectoryExists('C:\os2\bit\');
|
---|
1123 |
|
---|
1124 | assertFalse('testDirectoryExists_NotExistent', tmpResult);
|
---|
1125 | end;
|
---|
1126 |
|
---|
1127 |
|
---|
1128 | Procedure testDirectoryExists_Archived;
|
---|
1129 | var
|
---|
1130 | tmpResult : Boolean;
|
---|
1131 | begin
|
---|
1132 | tmpResult := DirectoryExists(TEST_PATH + '\unittests\testdir\dir_archived');
|
---|
1133 |
|
---|
1134 | assertTrue('testDirectoryExists_Archived', tmpResult);
|
---|
1135 | end;
|
---|
1136 |
|
---|
1137 |
|
---|
1138 | Procedure testDirectoryExists_Hidden;
|
---|
1139 | var
|
---|
1140 | tmpResult : Boolean;
|
---|
1141 | begin
|
---|
1142 | tmpResult := DirectoryExists(TEST_PATH + '\unittests\testdir\dir_hidden');
|
---|
1143 |
|
---|
1144 | assertTrue('testDirectoryExists_Hidden', tmpResult);
|
---|
1145 | end;
|
---|
1146 |
|
---|
1147 |
|
---|
1148 | Procedure testDirectoryExists_Readonly;
|
---|
1149 | var
|
---|
1150 | tmpResult : Boolean;
|
---|
1151 | begin
|
---|
1152 | tmpResult := DirectoryExists(TEST_PATH + '\unittests\testdir\dir_readonly');
|
---|
1153 |
|
---|
1154 | assertTrue('testDirectoryExists_Readonly', tmpResult);
|
---|
1155 | end;
|
---|
1156 |
|
---|
1157 |
|
---|
1158 | Procedure testDirectoryExists_System;
|
---|
1159 | var
|
---|
1160 | tmpResult : Boolean;
|
---|
1161 | begin
|
---|
1162 | tmpResult := DirectoryExists(TEST_PATH + '\unittests\testdir\dir_system');
|
---|
1163 |
|
---|
1164 | assertTrue('testDirectoryExists_System', tmpResult);
|
---|
1165 | end;
|
---|
1166 |
|
---|
1167 |
|
---|
1168 | // ----------------------------------------------------------
|
---|
1169 |
|
---|
1170 |
|
---|
1171 | Procedure testDriveLetterToDriveNumber;
|
---|
1172 | var
|
---|
1173 | tmpResult : longint;
|
---|
1174 | begin
|
---|
1175 | tmpResult := DriveLetterToDriveNumber('A');
|
---|
1176 |
|
---|
1177 | assertEqualsInt('testDriveLetterToDriveNumber', 1, tmpResult);
|
---|
1178 | end;
|
---|
1179 |
|
---|
1180 |
|
---|
1181 | Procedure testDriveLetterToDriveNumber_LowerCase;
|
---|
1182 | var
|
---|
1183 | tmpResult : longint;
|
---|
1184 | begin
|
---|
1185 | tmpResult := DriveLetterToDriveNumber('a');
|
---|
1186 |
|
---|
1187 | assertEqualsInt('testDriveLetterToDriveNumber_LowerCase', 1, tmpResult);
|
---|
1188 | end;
|
---|
1189 |
|
---|
1190 |
|
---|
1191 | Procedure testDriveLetterToDriveNumber_Unknown;
|
---|
1192 | var
|
---|
1193 | tmpResult : longint;
|
---|
1194 | begin
|
---|
1195 | tmpResult := DriveLetterToDriveNumber('');
|
---|
1196 |
|
---|
1197 | assertEqualsInt('testDriveLetterToDriveNumber_Unknown', 0, tmpResult);
|
---|
1198 | end;
|
---|
1199 |
|
---|
1200 |
|
---|
1201 | // ----------------------------------------------------------
|
---|
1202 |
|
---|
1203 |
|
---|
1204 | Procedure testDriveNumberToDriveLetter;
|
---|
1205 | begin
|
---|
1206 | assertEqualsString('testDriveNumberToDriveLetter 1', 'A', DriveNumberToDriveLetter(1));
|
---|
1207 | assertEqualsString('testDriveNumberToDriveLetter 2', 'B', DriveNumberToDriveLetter(2));
|
---|
1208 | end;
|
---|
1209 |
|
---|
1210 |
|
---|
1211 | // ----------------------------------------------------------
|
---|
1212 |
|
---|
1213 |
|
---|
1214 | Procedure testGetBootDriveLetter;
|
---|
1215 | var
|
---|
1216 | tmpResult : char;
|
---|
1217 | begin
|
---|
1218 | tmpResult := GetBootDriveLetter;
|
---|
1219 |
|
---|
1220 | assertEqualsString('testGetBootDriveLetter', 'C', tmpResult);
|
---|
1221 | end;
|
---|
1222 |
|
---|
1223 |
|
---|
1224 | // ----------------------------------------------------------
|
---|
1225 |
|
---|
1226 |
|
---|
1227 | Procedure testFileIsReadOnly_False;
|
---|
1228 | var
|
---|
1229 | tmpResult : boolean;
|
---|
1230 | begin
|
---|
1231 | tmpResult := FileIsReadOnly(GetBootDriveLetter + ':\config.sys');
|
---|
1232 |
|
---|
1233 | assertFalse('testFileIsReadOnly_False', tmpResult);
|
---|
1234 | end;
|
---|
1235 |
|
---|
1236 |
|
---|
1237 | Procedure testFileIsReadOnly_True;
|
---|
1238 | var
|
---|
1239 | tmpResult : boolean;
|
---|
1240 | begin
|
---|
1241 | tmpResult := FileIsReadOnly(GetBootDriveLetter + ':\os2ldr');
|
---|
1242 |
|
---|
1243 | assertTrue('testFileIsReadOnly_True', tmpResult);
|
---|
1244 | end;
|
---|
1245 |
|
---|
1246 |
|
---|
1247 | // ----------------------------------------------------------
|
---|
1248 |
|
---|
1249 |
|
---|
1250 | Function getFileUtilsUnitTests : TList;
|
---|
1251 | Begin
|
---|
1252 | result := TList.Create;
|
---|
1253 |
|
---|
1254 | result.add(@testAddDirectorySeparator_Empty);
|
---|
1255 | result.add(@testAddDirectorySeparator_SingleChar);
|
---|
1256 | result.add(@testAddDirectorySeparator_ManyChars);
|
---|
1257 | result.add(@testAddDirectorySeparator_SlashAtEnd);
|
---|
1258 |
|
---|
1259 | result.add(@testAddDirectorySeparatorIfNotEmpty_Empty);
|
---|
1260 | result.add(@testAddDirectorySeparatorIfNotEmpty_SingleChar);
|
---|
1261 | result.add(@testAddDirectorySeparatorIfNotEmpty_ManyChars);
|
---|
1262 | result.add(@testAddDirectorySeparatorIfNotEmpty_SlashAtEnd);
|
---|
1263 |
|
---|
1264 | result.add(@testRemoveRightDirectorySeparator_Empty);
|
---|
1265 | result.add(@testRemoveRightDirectorySeparator_WithoutSlash);
|
---|
1266 | result.add(@testRemoveRightDirectorySeparator_WithSlash);
|
---|
1267 |
|
---|
1268 | result.add(@testExpandPath_BothEmpty);
|
---|
1269 | result.add(@testExpandPath_PathEmpty);
|
---|
1270 | result.add(@testExpandPath_PathEmptyDirEndsWithSlash);
|
---|
1271 | result.add(@testExpandPath_AbsolutePath);
|
---|
1272 | result.add(@testExpandPath_DriveWithSlash);
|
---|
1273 | result.add(@testExpandPath_DriveWithoutSlash);
|
---|
1274 | result.add(@testExpandPath_RootPathForDrive);
|
---|
1275 | result.add(@testExpandPath_RootDirForDrive);
|
---|
1276 | result.add(@testExpandPath_RootPathWithoutDrive);
|
---|
1277 | result.add(@testExpandPath_RootDirWithoutDrive);
|
---|
1278 | result.add(@testExpandPath_AppendWithSlash);
|
---|
1279 | result.add(@testExpandPath_AppendWithoutSlash);
|
---|
1280 | result.add(@testExpandPath_AppendWithSlashAtEnd);
|
---|
1281 | result.add(@testExpandPath_WithDot);
|
---|
1282 | result.add(@testExpandPath_WithDotAtEnd);
|
---|
1283 | result.add(@testExpandPath_WithDots);
|
---|
1284 | result.add(@testExpandPath_WithDotsAtEnd);
|
---|
1285 | result.add(@testExpandPath_WithDotsInFront);
|
---|
1286 | result.add(@testExpandPath_WithDotsInFrontReachingRoot);
|
---|
1287 | result.add(@testExpandPath_WithDotsInFrontReachingDrive);
|
---|
1288 | result.add(@testExpandPath_WithDotsInFrontLeavingRoot);
|
---|
1289 | result.add(@testExpandPath_WithDotsInFrontLeavingDrive);
|
---|
1290 |
|
---|
1291 | result.add(@testGetLogFilesDir);
|
---|
1292 |
|
---|
1293 | result.add(@testSearchPath_Found);
|
---|
1294 | result.add(@testSearchPath_FoundMixedCase);
|
---|
1295 | result.add(@testSearchPath_NotFound);
|
---|
1296 | result.add(@testSearchPath_NotExistingEnvironment);
|
---|
1297 |
|
---|
1298 | result.add(@testSearchHelpPaths_FoundBookshelf);
|
---|
1299 | result.add(@testSearchHelpPaths_FoundHelp);
|
---|
1300 | // result.add(@testSearchHelpPaths_DontSearchInAppDir);
|
---|
1301 | result.add(@testSearchHelpPaths_FoundInAppDir);
|
---|
1302 | result.add(@testSearchHelpPaths_NotFoundInAppDir);
|
---|
1303 |
|
---|
1304 | result.add(@testFindDefaultLanguageHelpFile);
|
---|
1305 | result.add(@testFindDefaultLanguageHelpFile_it);
|
---|
1306 | result.add(@testFindDefaultLanguageHelpFile_it_UpperCase);
|
---|
1307 |
|
---|
1308 | result.add(@testGetDirsInPath_Unknown);
|
---|
1309 | result.add(@testGetDirsInPath_Help);
|
---|
1310 |
|
---|
1311 | result.add(@testListFilesInDirectory_NoFiles);
|
---|
1312 | result.add(@testListFilesInDirectory_EmptyFilter);
|
---|
1313 | result.add(@testListFilesInDirectory_OneFile);
|
---|
1314 | result.add(@testListFilesInDirectory_ManyFiles);
|
---|
1315 | result.add(@testListFilesInDirectory_ManyFilter);
|
---|
1316 | result.add(@testListFilesInDirectoryWithDirectoryInResult_NoFiles);
|
---|
1317 | result.add(@testListFilesInDirectoryWithDirectoryInResult_EmptyFilter);
|
---|
1318 | result.add(@testListFilesInDirectoryWithDirectoryInResult_OneFile);
|
---|
1319 | result.add(@testListFilesInDirectoryWithDirectoryInResult_ManyFiles);
|
---|
1320 | result.add(@testListFilesInDirectoryWithDirectoryInResult_ManyFilter);
|
---|
1321 |
|
---|
1322 | result.add(@testListSubDirectories_None);
|
---|
1323 | result.add(@testListSubDirectories_NoneWithHidden);
|
---|
1324 | result.add(@testListSubDirectories_Many);
|
---|
1325 | result.add(@testListSubDirectories_ManyWithHidden);
|
---|
1326 |
|
---|
1327 | result.add(@testListFilesInDirectoryRecursiveWithTermination);
|
---|
1328 | result.add(@testListFilesInDirectoryRecursiveWithTermination_WithHidden);
|
---|
1329 | result.add(@testListFilesInDirectoryRecursiveWithTermination_WithDirAndHidden);
|
---|
1330 | result.add(@testListFilesInDirectoryRecursiveWithTermination_WithDirectoryInResult);
|
---|
1331 | result.add(@testListFilesInDirectoryRecursiveWithTermination_1WithDirectoryInResultWithHidden);
|
---|
1332 |
|
---|
1333 | result.add(@testParentDir_Empty);
|
---|
1334 | result.add(@testParentDir_Root);
|
---|
1335 | result.add(@testParentDir_UnixRoot);
|
---|
1336 | result.add(@testParentDir);
|
---|
1337 | result.add(@testParentDir_OnlyOne);
|
---|
1338 | result.add(@testParentDir_SlashAtEnd);
|
---|
1339 | result.add(@testParentDir_NoSlashAtStart);
|
---|
1340 | result.add(@testParentDir_NoSlash);
|
---|
1341 | result.add(@testParentDir_GoToRootDrive);
|
---|
1342 |
|
---|
1343 | result.add(@testMakeDirs_Empty);
|
---|
1344 | result.add(@testMakeDirs_Slash);
|
---|
1345 | result.add(@testMakeDirs_Simple);
|
---|
1346 | result.add(@testMakeDirs_Complex);
|
---|
1347 |
|
---|
1348 | result.add(@testDirectoryExists_Empty);
|
---|
1349 | result.add(@testDirectoryExists_DriveOnlyLowercase);
|
---|
1350 | result.add(@testDirectoryExists_DriveOnlyUppercase);
|
---|
1351 | result.add(@testDirectoryExists_DriveOnlySlashAtEnd);
|
---|
1352 | result.add(@testDirectoryExists_DriveAndPath);
|
---|
1353 | result.add(@testDirectoryExists_DriveAndPathSlashAtEnd);
|
---|
1354 | result.add(@testDirectoryExists_InvalidDrive);
|
---|
1355 | result.add(@testDirectoryExists_InvalidDriveAndPath);
|
---|
1356 | result.add(@testDirectoryExists_NotExistent);
|
---|
1357 |
|
---|
1358 | result.add(@testDriveLetterToDriveNumber);
|
---|
1359 | result.add(@testDriveLetterToDriveNumber_LowerCase);
|
---|
1360 | result.add(@testDriveLetterToDriveNumber_Unknown);
|
---|
1361 |
|
---|
1362 | result.add(@testDriveNumberToDriveLetter);
|
---|
1363 |
|
---|
1364 | result.add(@testGetBootDriveLetter);
|
---|
1365 |
|
---|
1366 | result.add(@testFileIsReadOnly_False);
|
---|
1367 | result.add(@testFileIsReadOnly_True);
|
---|
1368 |
|
---|
1369 | end;
|
---|
1370 |
|
---|
1371 | End.
|
---|