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