1 |
|
package org.qedeq.kernel.bo.parser; |
2 |
|
|
3 |
|
import java.io.File; |
4 |
|
import java.util.List; |
5 |
|
|
6 |
|
import org.qedeq.base.io.TextInput; |
7 |
|
import org.qedeq.kernel.xml.handler.parser.LoadXmlOperatorListUtility; |
8 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (31) |
Complexity: 15 |
Complexity Density: 0,94 |
|
9 |
|
public class LatexMathParserTest extends AbstractParserTest { |
10 |
|
|
11 |
|
private static String[][] test = new String[][] { |
12 |
|
{ |
13 |
|
"(A \\lor A) \\impl A", |
14 |
|
"IMPL(OR(A(), A()), A())" |
15 |
|
}, { |
16 |
|
"A \\impl (A \\lor B)", |
17 |
|
"IMPL(A(), OR(A(), B()))" |
18 |
|
}, { |
19 |
|
"(A \\lor B) \\impl (B \\lor A)", |
20 |
|
"IMPL(OR(A(), B()), OR(B(), A()))" |
21 |
|
}, { |
22 |
|
"(A \\impl B) \\impl ((C \\lor A) \\impl (C \\lor B))", |
23 |
|
"IMPL(IMPL(A(), B()), IMPL(OR(C(), A()), OR(C(), B())))" |
24 |
|
}, { |
25 |
|
"(\\forall x~\\phi(x)) \\impl \\phi(y)", |
26 |
|
"IMPL(ALL(x(), PREDVAR_1(x())), PREDVAR_1(y()))" |
27 |
|
}, { |
28 |
|
"\\phi(y) \\impl (\\exists x~\\phi(x))", |
29 |
|
"IMPL(PREDVAR_1(y()), EXISTS(x(), PREDVAR_1(x())))" |
30 |
|
}, { |
31 |
|
"$$\\alpha \\land \\beta \\ \\defp \\ \\neg(\\neg\\alpha \\lor \\neg\\beta)$$", |
32 |
|
"DEFP(AND(PREDVAR_3(), PREDVAR_4()), NOT(OR(NOT(PREDVAR_3()), NOT(PREDVAR_4()))))" |
33 |
|
}, { |
34 |
|
"$$\\alpha \\impl \\beta \\ \\defp \\ \\neg\\alpha \\lor \\beta$$", |
35 |
|
"DEFP(IMPL(PREDVAR_3(), PREDVAR_4()), OR(NOT(PREDVAR_3()), PREDVAR_4()))" |
36 |
|
}, { |
37 |
|
"$$\\alpha \\equi \\beta \\ \\defp \\ (\\alpha \\impl \\beta) \\land (\\beta \\impl \\alpha)$$", |
38 |
|
"DEFP(EQUI(PREDVAR_3(), PREDVAR_4()), AND(IMPL(PREDVAR_3(), PREDVAR_4()), IMPL(PREDVAR_4(), PREDVAR_3())))" |
39 |
|
}, { |
40 |
|
"$\\alpha \\impl (\\forall x_1~(\\beta(x_1)))$", |
41 |
|
"IMPL(PREDVAR_3(), ALL(x_1(), PREDVAR_4(x_1())))" |
42 |
|
} |
43 |
|
}; |
44 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
45 |
11
|
public LatexMathParserTest(String arg0) {... |
46 |
11
|
super(arg0); |
47 |
|
} |
48 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
49 |
11
|
protected void setUp() throws Exception {... |
50 |
11
|
super.setUp(); |
51 |
|
} |
52 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
53 |
11
|
protected void tearDown() throws Exception {... |
54 |
11
|
super.tearDown(); |
55 |
|
} |
56 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
57 |
51
|
protected String[][] getTest() {... |
58 |
51
|
return test; |
59 |
|
} |
60 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0,5 |
|
61 |
11
|
protected MathParser createParser(final TextInput input) throws Exception {... |
62 |
11
|
final List operators = LoadXmlOperatorListUtility.getOperatorList(new File(getIndir(), |
63 |
|
"parser/latexMathOperators.xml")); |
64 |
11
|
return new LatexMathParser(input, operators); |
65 |
|
} |
66 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
1
PASS
|
|
67 |
1
|
public void testReadMaximalTerm00() throws Exception {... |
68 |
1
|
internalTest(0); |
69 |
|
} |
70 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
1
PASS
|
|
71 |
1
|
public void testReadMaximalTerm01() throws Exception {... |
72 |
1
|
internalTest(1); |
73 |
|
} |
74 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
1
PASS
|
|
75 |
1
|
public void testReadMaximalTerm02() throws Exception {... |
76 |
1
|
internalTest(2); |
77 |
|
} |
78 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
1
PASS
|
|
79 |
1
|
public void testReadMaximalTerm03() throws Exception {... |
80 |
1
|
internalTest(3); |
81 |
|
} |
82 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
1
PASS
|
|
83 |
1
|
public void testReadMaximalTerm04() throws Exception {... |
84 |
1
|
internalTest(4); |
85 |
|
} |
86 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
1
PASS
|
|
87 |
1
|
public void testReadMaximalTerm05() throws Exception {... |
88 |
1
|
internalTest(5); |
89 |
|
} |
90 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
1
PASS
|
|
91 |
1
|
public void testReadMaximalTerm06() throws Exception {... |
92 |
1
|
internalTest(6); |
93 |
|
} |
94 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
1
PASS
|
|
95 |
1
|
public void testReadMaximalTerm07() throws Exception {... |
96 |
1
|
internalTest(7); |
97 |
|
} |
98 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
1
PASS
|
|
99 |
1
|
public void testReadMaximalTerm08() throws Exception {... |
100 |
1
|
internalTest(8); |
101 |
|
} |
102 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
1
PASS
|
|
103 |
1
|
public void testReadMaximalTerm09() throws Exception {... |
104 |
1
|
internalTest(9); |
105 |
|
} |
106 |
|
|
107 |
|
} |