-
Notifications
You must be signed in to change notification settings - Fork 1
/
tests.php
95 lines (80 loc) · 3.22 KB
/
tests.php
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
<?php
require_once('../save_bilingual_txt.php');
# Test 0.0 - Normal
$fileAddress1 = "./le_petit_prince_fr.txt";
$fileAddress2 = "./le_petit_prince_de.txt";
$outputFileAddress = "./results/le_petit_prince_fr_de.0.0.txt";
saveBilingualTxt($fileAddress1, $fileAddress2, $outputFileAddress);
# Test 0.1 - Input file 2 is shoter that input file 1
$fileAddress1 = "./le_petit_prince_fr.txt";
$fileAddress2 = "./le_petit_prince_de.short.txt";
$outputFileAddress = "./results/le_petit_prince_fr_de.0.1.txt";
saveBilingualTxt($fileAddress1, $fileAddress2, $outputFileAddress);
require_once('../save_bilingual_fb2.php');
# Test 1.0
$fileAddress1 = "./le_petit_prince_fr.txt";
$fileAddress2 = "./le_petit_prince_de.txt";
$outputFileAddress = "./results/le_petit_prince_fr_de.1.0.fb2";
$coverAddress = "./img/cover.png";
$picsFolder = "./img";
$lang1 = 'fr';
$lang2 = 'de';
$id = 'le_petit_prince.test.1.0';
saveBilingualFb2($fileAddress1, $fileAddress2, $outputFileAddress,
$coverAddress, $picsFolder, $lang1, $lang2, $id);
# Test 1.1 - Wrong folder for cover and pictures
$fileAddress1 = "./le_petit_prince_fr.txt";
$fileAddress2 = "./le_petit_prince_de.txt";
$outputFileAddress = "./results/le_petit_prince_fr_de.1.1.fb2";
$coverAddress = "./pics/cover.png";
$picsFolder = "./pics";
$lang1 = 'fr';
$lang2 = 'de';
$id = 'le_petit_prince.test.1.1';
saveBilingualFb2($fileAddress1, $fileAddress2, $outputFileAddress,
$coverAddress, $picsFolder, $lang1, $lang2, $id);
# Test 1.2 - Input file 2 is shoter that input file 1
$fileAddress1 = "./le_petit_prince_fr.txt";
$fileAddress2 = "./le_petit_prince_de.short.txt";
$outputFileAddress = "./results/le_petit_prince_fr_de.1.2.fb2";
$coverAddress = "./img/cover.png";
$picsFolder = "./img";
$lang1 = 'fr';
$lang2 = 'de';
$id = 'le_petit_prince.test.1.2';
saveBilingualFb2($fileAddress1, $fileAddress2, $outputFileAddress,
$coverAddress, $picsFolder, $lang1, $lang2, $id);
require_once('../save_bilingual_epub.php');
# Test 2.0 - Normal
$fileAddress1 = "./le_petit_prince_fr.txt";
$fileAddress2 = "./le_petit_prince_de.txt";
$outputFileAddress = "./results/le_petit_prince_fr_de.2.0.epub";
$coverAddress = "./img/cover.png";
$picsFolder = "./img";
$lang1 = 'fr';
$lang2 = 'de';
$id = 'le_petit_prince.test.2.0';
saveBilingualEpub($fileAddress1, $fileAddress2, $outputFileAddress,
$coverAddress, $picsFolder, $lang1, $lang2, $id);
# Test 2.1 - Wrong folder for cover and pictures
$fileAddress1 = "./le_petit_prince_fr.txt";
$fileAddress2 = "./le_petit_prince_de.txt";
$outputFileAddress = "./results/le_petit_prince_fr_de.2.1.epub";
$coverAddress = "./pics/cover.png";
$picsFolder = "./pics";
$lang1 = 'fr';
$lang2 = 'de';
$id = 'le_petit_prince.test.2.1';
saveBilingualEpub($fileAddress1, $fileAddress2, $outputFileAddress,
$coverAddress, $picsFolder, $lang1, $lang2, $id);
# Test 2.2 - Input file 2 is shoter that input file 1
$fileAddress1 = "./le_petit_prince_fr.txt";
$fileAddress2 = "./le_petit_prince_de.short.txt";
$outputFileAddress = "./results/le_petit_prince_fr_de.2.2.epub";
$coverAddress = "./img/cover.png";
$picsFolder = "./img";
$lang1 = 'fr';
$lang2 = 'de';
$id = 'le_petit_prince.test.2.2';
saveBilingualEpub($fileAddress1, $fileAddress2, $outputFileAddress,
$coverAddress, $picsFolder, $lang1, $lang2, $id);