-
Notifications
You must be signed in to change notification settings - Fork 3
/
test.sh
executable file
·626 lines (493 loc) · 19.4 KB
/
test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
#!/usr/bin/env bash
# Script that test the other script.
# Yeah, we are that good on bash.
# Path to the script or alias
PACKAGE='./rch.sh'
# @param 1. The old string that should have the source
# @param 2. The directory with the sources (should not exist)
# @param 3. The path to the first file that will be tested
# @param 4. The path to the second file that will be tested
generate_sources() {
echo " [+] Generating source files.."
# Lets write some boring stuff because we are testing ¬.¬
local readonly OLD="$1"
local readonly DIRECTORY="$2"
local readonly SOURCE_FILE_ONE="$3"
local readonly SOURCE_FILE_TWO="$4"
local readonly OUTPUT='Hello World!'
# Create directory
mkdir "$DIRECTORY";
# Create the sources
OUTPUT="FILE 1. This is going to be the only line. So - $OLD - should change and '$OLD' too."
# OUTPUT=$OUTPUT"\nThis is going to be $OLD on a first line."
# OUTPUT=$OUTPUT"\nThis is going to be $OLD on a second line."
# OUTPUT=$OUTPUT"\nThis is going to be $OLD on a third line."
# Store the content
echo "$OUTPUT" > "$SOURCE_FILE_ONE";
OUTPUT="FILE 2. This is going to be the only line. So - $OLD - should change and '$OLD' too."
echo "$OUTPUT" > "$SOURCE_FILE_TWO";
}
# Used to remove the directories generated while testing
#
# @param The full path to the directory to remove
remove_sources() {
echo " [+] Removing obsolete files.."
rm -R "$*";
}
# Run the script using a directory as target
#
# @param 1. The old string to replace
# @param 2. The new string that will replace
# @param 3. The directory with the files to test
run_script_using_directory() {
local readonly OLD="$1"
local readonly NEW="$2"
local readonly DIRECTORY="$3"
# Run the script
$PACKAGE -o "$OLD" -n "$NEW" -d "$DIRECTORY"
}
# Run the script using a pattern as target
#
# @param 1. The old string to replace
# @param 2. The new string that will replace
# @param 3. The pattern of the path with files to test
run_script_using_pattern() {
local readonly OLD="$1"
local readonly NEW="$2"
local readonly PATTERN="$3"
# Run the script
$PACKAGE -o "$OLD" -n "$NEW" -p "$PATTERN"
}
# Test the script using a directory as target with a backup directory
#
# @param 1. The old string to replace
# @param 2. The new string that will replace
# @param 3. The directory with the files to test
# @param 4. The directory for the backup
run_script_using_directory_with_backup() {
local readonly OLD="$1"
local readonly NEW="$2"
local readonly DIRECTORY="$3"
local readonly BACKUP="$4"
# Run the script
$PACKAGE -o "$OLD" -n "$NEW" -p "$DIRECTORY" -b "$BACKUP"
}
# Test the script using a pattern as target with a backup directory
#
# @param 1. The old string to replace
# @param 2. The new string that will replace
# @param 3. The pattern of the path with files to test
# @param 4. The directory for the backup
run_script_using_pattern_with_backup() {
local readonly OLD="$1"
local readonly NEW="$2"
local readonly PATTERN="$3"
local readonly BACKUP="$4"
# Run the script
$PACKAGE -o "$OLD" -n "$NEW" -p "$PATTERN" -b "$BACKUP"
}
# Check if the content of the target file
# is equal to the expected value
#
# @param 1. The old string that should not be
# @param 2. The new string that should be
# @param 3. The pattern to the files to check
# @param 4. The amount of files that should be
# @return When error 1, otherwise 0
check_results() {
local readonly OLD="$1"
local readonly NEW="$2"
local readonly PATTERN="$3"
# The amount of files that should exists and actually exists
local readonly EXISTS=0
local readonly SHOULD_EXISTS="$4"
# Iterate over the files
for f in $PATTERN;
do
if [ "$f" != '.' ];
then
should_be_empty=`grep -s $OLD "$f"` # Remove -s to get messages on standar output
should_have_content=`grep -s $NEW "$f"` # Same here, remove -s if you want to
# Check for errors
if [ ! -z "$should_be_empty" -o -z "$should_have_content" ];
then
echo 1; # Because things are not as expected, return error!
return;
fi
EXISTS=$(( $EXISTS + 1 ))
fi
done
# If it didn't return previously and
# the amount of files presents are equal
# to the expected number, then everything is ok
if [[ $EXISTS == $SHOULD_EXISTS ]]; then
echo 0;
else
echo 1;
fi
}
# It try and hopes for good results
# Way: using a directory
#
# @param 1. The old string to replace
# @param 2. The new string that will replace
# @param 3. The directory with the files to test
# @param 4. The pattern of the path with files to test
# @param 5. The amount of files that should be
optimistic_using_directory() {
run_script_using_directory "$1" "$2" "$3"
echo `check_results "$1" "$2" "$4" "$5"`
}
# It try and hopes for bad results doing bad things.
# How? Removing the source file
# Way: using a directory
#
# @param 1. The old string to replace
# @param 2. The new string that will replace
# @param 3. The directory with the files to test
# @param 4. The pattern of the path with files to test
# @param 5. The amount of files that should be
# @param 6. The first source file that should exist
pessimistic_remove_source_using_directory() {
run_script_using_directory "$1" "$2" "$3"
rm "$6";
real_result=`check_results "$1" "$2" "$4" "$5"`
# We are waiting for errors!
if [[ $real_result == 1 ]]; then
echo 0;
else
echo 1;
fi
}
# It try and hopes for bad results doing bad things.
# How? Removing the directory to the path with files to test
# Way: using a directory
#
# @param 1. The old string to replace
# @param 2. The new string that will replace
# @param 3. The directory with the files to test
# @param 4. The pattern of the path with files to test
# @param 5. The amount of files that should be
pessimistic_remove_directory_using_directory() {
run_script_using_directory "$1" "$2" "$3"
rm -R "$3";
real_result=`check_results "$1" "$2" "$4" "$5"`
# We are waiting for errors!
if [[ $real_result == 1 ]]; then
echo 0;
else
echo 1;
fi
}
# It try and hopes for good results
# Way: using a pattern
#
# @param 1. The old string to replace
# @param 2. The new string that will replace
# @param 3. The pattern with the files to test
# @param 4. The amount of files that should be
optimistic_using_pattern() {
run_script_using_pattern "$1" "$2" "$3"
echo `check_results "$1" "$2" "$3" "$4"`
}
# It try and hopes for bad results doing bad things.
# How? Removing the source file
# Way: using a pattern
#
# @param 1. The old string to replace
# @param 2. The new string that will replace
# @param 3. The pattern with the files to test
# @param 4. The amount of files that should be
# @param 5. The first source file that should exist
pessimistic_remove_source_using_pattern() {
run_script_using_pattern "$1" "$2" "$3"
rm "$5";
real_result=`check_results "$1" "$2" "$3" "$4"`
# We are waiting for errors!
if [[ $real_result == 1 ]]; then
echo 0;
else
echo 1;
fi
}
# It try and hopes for bad results doing bad things.
# How? Removing the pattern to the path with files to test
# Way: using a pattern
#
# @param 1. The old string to replace
# @param 2. The new string that will replace
# @param 3. The directory with the files to test
# @param 4. The pattern to the path with files to test
# @param 5. The amount of files that should be
pessimistic_remove_directory_using_pattern() {
run_script_using_pattern "$1" "$2" "$4"
rm -R "$3";
real_result=`check_results "$1" "$2" "$4" "$5"`
# We are waiting for errors!
if [[ $real_result == 1 ]]; then
echo 0;
else
echo 1;
fi
}
# Set the conditions to run a script
#
# @param 1. The old string that should have the source
# @param 2. The directory with the sources (should not exist)
# @param 3. The path to the first file that will be tested
# @param 4. The path to the second file that will be tested
setup() {
generate_sources "$1" "$2" "$3" "$4"
}
# Set the conditions to finish a script
#
# @param 1. [OPTIONAL] The directory with the files to test
# @param 2. [OPTIONAL] The directory for the backup
teardown() {
if [ ! -z "$1" ];
then
remove_sources "$1"
fi
# Check if backup was giving
if [ ! -z "$2" ];
then
remove_sources "$2"
fi
}
# Display to the user weter a test result is correct or not
#
# @param 1. The result of the latest test
# @param 2. The number of the test
print_partial_result() {
case "$1" in
"0")
echo " -> Test $2 passed!"
;;
"1")
echo " -> Test $2 failed."
;;
*)
echo " -> There were internal errors executing the test $2."
;;
esac
}
run_all_the_tests() {
local OLD='sad'
local NEW='happy'
local BACKUP="/home/user/testing/backup_test_$$"
local DIRECTORY="/home/user/testing/test_$$"
local DIRECTORY_SLASH="/home/user/testing/test_$$/"
local RELATIVE_DIRECTORY=~/testing/test_$$
local RELATIVE_DIRECTORY_SLASH=~/testing/test_$$/
local PATTERN="$DIRECTORY/*.tst"
local SOURCE_FILE_ONE="$DIRECTORY/first.tst"
local SOURCE_FILE_TWO="$DIRECTORY/second.tst"
local amount_of_files=2 # The number of files to test
local result=-1
local test_number=0
#exit 0 # Use this to stop the execution flow in some test
# ~*~ TEST ~*~ TEST ~*~ TEST #
# #
# Set of test without backup #
# using directory as target #
# #
# ~*~ TEST ~*~ TEST ~*~ TEST #
# Kill it with fire!
setup "$OLD" "$DIRECTORY" "$SOURCE_FILE_ONE" "$SOURCE_FILE_TWO"
result=`optimistic_using_directory "$OLD" "$NEW" "$DIRECTORY" "$PATTERN" "$amount_of_files"`
teardown "$DIRECTORY"
test_number=$(( $test_number + 1 ))
print_partial_result "$result" "$test_number"
# Kill it with fire!
setup "$OLD" "$DIRECTORY" "$SOURCE_FILE_ONE" "$SOURCE_FILE_TWO"
result=`pessimistic_remove_source_using_directory "$OLD" "$NEW" "$DIRECTORY" "$PATTERN" "$amount_of_files" "$SOURCE_FILE_ONE"`
teardown "$DIRECTORY"
test_number=$(( $test_number + 1 ))
print_partial_result "$result" "$test_number"
# Kill it with fire!
setup "$OLD" "$DIRECTORY" "$SOURCE_FILE_ONE" "$SOURCE_FILE_TWO"
result=`pessimistic_remove_directory_using_directory "$OLD" "$NEW" "$DIRECTORY" "$PATTERN" "$amount_of_files" "$SOURCE_FILE_ONE"`
teardown #"$DIRECTORY" Directory should have been removed on test
test_number=$(( $test_number + 1 ))
print_partial_result "$result" "$test_number"
# ~*~ TEST ~*~ TEST ~*~ TEST #
# #
# Set of test without backup #
# with a trailing slash #
# using directory as target #
# #
# ~*~ TEST ~*~ TEST ~*~ TEST #
# Kill it with fire!
setup "$OLD" "$DIRECTORY_SLASH" "$SOURCE_FILE_ONE" "$SOURCE_FILE_TWO"
result=`optimistic_using_directory "$OLD" "$NEW" "$DIRECTORY_SLASH" "$PATTERN" "$amount_of_files"`
teardown "$DIRECTORY_SLASH"
test_number=$(( $test_number + 1 ))
print_partial_result "$result" "$test_number"
# Kill it with fire!
setup "$OLD" "$DIRECTORY_SLASH" "$SOURCE_FILE_ONE" "$SOURCE_FILE_TWO"
result=`pessimistic_remove_source_using_directory "$OLD" "$NEW" "$DIRECTORY_SLASH" "$PATTERN" "$amount_of_files" "$SOURCE_FILE_ONE"`
teardown "$DIRECTORY_SLASH"
test_number=$(( $test_number + 1 ))
print_partial_result "$result" "$test_number"
# Kill it with fire!
setup "$OLD" "$DIRECTORY_SLASH" "$SOURCE_FILE_ONE" "$SOURCE_FILE_TWO"
result=`pessimistic_remove_directory_using_directory "$OLD" "$NEW" "$DIRECTORY_SLASH" "$PATTERN" "$amount_of_files" "$SOURCE_FILE_ONE"`
teardown #"$DIRECTORY_SLASH" Directory should have been removed on test
test_number=$(( $test_number + 1 ))
print_partial_result "$result" "$test_number"
# ~*~ TEST ~*~ TEST ~*~ TEST #
# #
# Set of test without backup #
# with relative directory #
# using directory as target #
# #
# ~*~ TEST ~*~ TEST ~*~ TEST #
# Kill it with fire!
setup "$OLD" "$RELATIVE_DIRECTORY" "$SOURCE_FILE_ONE" "$SOURCE_FILE_TWO"
result=`optimistic_using_directory "$OLD" "$NEW" "$RELATIVE_DIRECTORY" "$PATTERN" "$amount_of_files"`
teardown "$RELATIVE_DIRECTORY"
test_number=$(( $test_number + 1 ))
print_partial_result "$result" "$test_number"
# Kill it with fire!
setup "$OLD" "$RELATIVE_DIRECTORY" "$SOURCE_FILE_ONE" "$SOURCE_FILE_TWO"
result=`pessimistic_remove_source_using_directory "$OLD" "$NEW" "$RELATIVE_DIRECTORY" "$PATTERN" "$amount_of_files" "$SOURCE_FILE_ONE"`
teardown "$RELATIVE_DIRECTORY"
test_number=$(( $test_number + 1 ))
print_partial_result "$result" "$test_number"
# Kill it with fire!
setup "$OLD" "$RELATIVE_DIRECTORY" "$SOURCE_FILE_ONE" "$SOURCE_FILE_TWO"
result=`pessimistic_remove_directory_using_directory "$OLD" "$NEW" "$RELATIVE_DIRECTORY" "$PATTERN" "$amount_of_files" "$SOURCE_FILE_ONE"`
teardown #"$RELATIVE_DIRECTORY" Directory should have been removed on test
test_number=$(( $test_number + 1 ))
print_partial_result "$result" "$test_number"
# ~*~ TEST ~*~ TEST ~*~ TEST #
# #
# Set of test without backup #
# with relative directory #
# with a trailing slash #
# using directory as target #
# #
# ~*~ TEST ~*~ TEST ~*~ TEST #
# Kill it with fire!
setup "$OLD" "$RELATIVE_DIRECTORY_SLASH" "$SOURCE_FILE_ONE" "$SOURCE_FILE_TWO"
result=`optimistic_using_directory "$OLD" "$NEW" "$RELATIVE_DIRECTORY_SLASH" "$PATTERN" "$amount_of_files"`
teardown "$RELATIVE_DIRECTORY_SLASH"
test_number=$(( $test_number + 1 ))
print_partial_result "$result" "$test_number"
# Kill it with fire!
setup "$OLD" "$RELATIVE_DIRECTORY_SLASH" "$SOURCE_FILE_ONE" "$SOURCE_FILE_TWO"
result=`pessimistic_remove_source_using_directory "$OLD" "$NEW" "$RELATIVE_DIRECTORY_SLASH" "$PATTERN" "$amount_of_files" "$SOURCE_FILE_ONE"`
teardown "$RELATIVE_DIRECTORY_SLASH"
test_number=$(( $test_number + 1 ))
print_partial_result "$result" "$test_number"
# Kill it with fire!
setup "$OLD" "$RELATIVE_DIRECTORY_SLASH" "$SOURCE_FILE_ONE" "$SOURCE_FILE_TWO"
result=`pessimistic_remove_directory_using_directory "$OLD" "$NEW" "$RELATIVE_DIRECTORY_SLASH" "$PATTERN" "$amount_of_files" "$SOURCE_FILE_ONE"`
teardown #"$RELATIVE_DIRECTORY_SLASH" Directory should have been removed on test
test_number=$(( $test_number + 1 ))
print_partial_result "$result" "$test_number"
####################
# NEW SET OF TESTS #
####################
# ~*~ TEST ~*~ TEST ~*~ TEST #
# #
# Set of test without backup #
# using path as target #
# #
# ~*~ TEST ~*~ TEST ~*~ TEST #
# Kill it with fire!
setup "$OLD" "$DIRECTORY" "$SOURCE_FILE_ONE" "$SOURCE_FILE_TWO"
result=`optimistic_using_pattern "$OLD" "$NEW" "$PATTERN" "$amount_of_files"`
teardown "$DIRECTORY"
test_number=$(( $test_number + 1 ))
print_partial_result "$result" "$test_number"
# Kill it with fire!
setup "$OLD" "$DIRECTORY" "$SOURCE_FILE_ONE" "$SOURCE_FILE_TWO"
result=`pessimistic_remove_source_using_pattern "$OLD" "$NEW" "$PATTERN" "$amount_of_files" "$SOURCE_FILE_ONE"`
teardown "$DIRECTORY"
test_number=$(( $test_number + 1 ))
print_partial_result "$result" "$test_number"
# Kill it with fire!
setup "$OLD" "$DIRECTORY" "$SOURCE_FILE_ONE" "$SOURCE_FILE_TWO"
result=`pessimistic_remove_directory_using_pattern "$OLD" "$NEW" "$DIRECTORY" "$PATTERN" "$amount_of_files" "$SOURCE_FILE_ONE"`
teardown #"$DIRECTORY" Directory should have been removed on test
test_number=$(( $test_number + 1 ))
print_partial_result "$result" "$test_number"
# ~*~ TEST ~*~ TEST ~*~ TEST #
# #
# Set of test without backup #
# with a trailing slash #
# using path as target #
# #
# ~*~ TEST ~*~ TEST ~*~ TEST #
# Kill it with fire!
setup "$OLD" "$DIRECTORY_SLASH" "$SOURCE_FILE_ONE" "$SOURCE_FILE_TWO"
result=`optimistic_using_pattern "$OLD" "$NEW" "$PATTERN" "$amount_of_files"`
teardown "$DIRECTORY_SLASH"
test_number=$(( $test_number + 1 ))
print_partial_result "$result" "$test_number"
# Kill it with fire!
setup "$OLD" "$DIRECTORY_SLASH" "$SOURCE_FILE_ONE" "$SOURCE_FILE_TWO"
result=`pessimistic_remove_source_using_pattern "$OLD" "$NEW" "$PATTERN" "$amount_of_files" "$SOURCE_FILE_ONE"`
teardown "$DIRECTORY_SLASH"
test_number=$(( $test_number + 1 ))
print_partial_result "$result" "$test_number"
# Kill it with fire!
setup "$OLD" "$DIRECTORY_SLASH" "$SOURCE_FILE_ONE" "$SOURCE_FILE_TWO"
result=`pessimistic_remove_directory_using_pattern "$OLD" "$NEW" "$DIRECTORY_SLASH" "$PATTERN" "$amount_of_files" "$SOURCE_FILE_ONE"`
teardown #"$DIRECTORY_SLASH" Directory should have been removed on test
test_number=$(( $test_number + 1 ))
print_partial_result "$result" "$test_number"
# ~*~ TEST ~*~ TEST ~*~ TEST #
# #
# Set of test without backup #
# with relative directory #
# using path as target #
# #
# ~*~ TEST ~*~ TEST ~*~ TEST #
# Kill it with fire!
setup "$OLD" "$RELATIVE_DIRECTORY" "$SOURCE_FILE_ONE" "$SOURCE_FILE_TWO"
result=`optimistic_using_pattern "$OLD" "$NEW" "$PATTERN" "$amount_of_files"`
teardown "$RELATIVE_DIRECTORY"
test_number=$(( $test_number + 1 ))
print_partial_result "$result" "$test_number"
# Kill it with fire!
setup "$OLD" "$RELATIVE_DIRECTORY" "$SOURCE_FILE_ONE" "$SOURCE_FILE_TWO"
result=`pessimistic_remove_source_using_pattern "$OLD" "$NEW" "$PATTERN" "$amount_of_files" "$SOURCE_FILE_ONE"`
teardown "$RELATIVE_DIRECTORY"
test_number=$(( $test_number + 1 ))
print_partial_result "$result" "$test_number"
# Kill it with fire!
setup "$OLD" "$RELATIVE_DIRECTORY" "$SOURCE_FILE_ONE" "$SOURCE_FILE_TWO"
result=`pessimistic_remove_directory_using_pattern "$OLD" "$NEW" "$RELATIVE_DIRECTORY" "$PATTERN" "$amount_of_files" "$SOURCE_FILE_ONE"`
teardown #"$RELATIVE_DIRECTORY" Directory should have been removed on test
test_number=$(( $test_number + 1 ))
print_partial_result "$result" "$test_number"
# ~*~ TEST ~*~ TEST ~*~ TEST #
# #
# Set of test without backup #
# with relative directory #
# with a trailing slash #
# using path as target #
# #
# ~*~ TEST ~*~ TEST ~*~ TEST #
# Kill it with fire!
setup "$OLD" "$RELATIVE_DIRECTORY_SLASH" "$SOURCE_FILE_ONE" "$SOURCE_FILE_TWO"
result=`optimistic_using_pattern "$OLD" "$NEW" "$PATTERN" "$amount_of_files"`
teardown "$RELATIVE_DIRECTORY_SLASH"
test_number=$(( $test_number + 1 ))
print_partial_result "$result" "$test_number"
# Kill it with fire!
setup "$OLD" "$RELATIVE_DIRECTORY_SLASH" "$SOURCE_FILE_ONE" "$SOURCE_FILE_TWO"
result=`pessimistic_remove_source_using_pattern "$OLD" "$NEW" "$PATTERN" "$amount_of_files" "$SOURCE_FILE_ONE"`
teardown "$RELATIVE_DIRECTORY_SLASH"
test_number=$(( $test_number + 1 ))
print_partial_result "$result" "$test_number"
# Kill it with fire!
setup "$OLD" "$RELATIVE_DIRECTORY_SLASH" "$SOURCE_FILE_ONE" "$SOURCE_FILE_TWO"
result=`pessimistic_remove_directory_using_pattern "$OLD" "$NEW" "$RELATIVE_DIRECTORY_SLASH" "$PATTERN" "$amount_of_files" "$SOURCE_FILE_ONE"`
teardown #"$RELATIVE_DIRECTORY_SLASH" Directory should have been removed on test
test_number=$(( $test_number + 1 ))
print_partial_result "$result" "$test_number"
}
run_all_the_tests "$@"