Clover Coverage Report
Coverage timestamp: Sat Sep 18 2010 04:09:52 UTC
16   110   15   1.07
0   90   0.94   15
15     1  
1    
 
  LatexMathParserTest       Line # 10 16 15 100% 1.0
 
  (11)
 
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   
 
10    public class LatexMathParserTest extends AbstractParserTest {
11   
12    private static String[][] test = new String[][] {
13    { // 00
14    "(A \\lor A) \\impl A",
15    "IMPL(OR(A(), A()), A())"
16    }, { // 01
17    "A \\impl (A \\lor B)",
18    "IMPL(A(), OR(A(), B()))"
19    }, { // 02
20    "(A \\lor B) \\impl (B \\lor A)",
21    "IMPL(OR(A(), B()), OR(B(), A()))"
22    }, { // 03
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    }, { // 04
26    "(\\forall x~\\phi(x)) \\impl \\phi(y)",
27    "IMPL(ALL(x(), PREDVAR_1(x())), PREDVAR_1(y()))"
28    }, { // 05
29    "\\phi(y) \\impl (\\exists x~\\phi(x))",
30    "IMPL(PREDVAR_1(y()), EXISTS(x(), PREDVAR_1(x())))"
31    }, { // 06
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    }, { // 07
35    "$$\\alpha \\impl \\beta \\ \\defp \\ \\neg\\alpha \\lor \\beta$$",
36    "DEFP(IMPL(PREDVAR_3(), PREDVAR_4()), OR(NOT(PREDVAR_3()), PREDVAR_4()))"
37    }, { // 08
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    }, { // 09
41    "$\\alpha \\impl (\\forall x_1~(\\beta(x_1)))$",
42    "IMPL(PREDVAR_3(), ALL(x_1(), PREDVAR_4(x_1())))"
43    }
44    };
45   
 
46  11 toggle public LatexMathParserTest(String arg0) {
47  11 super(arg0);
48    }
49   
 
50  11 toggle protected void setUp() throws Exception {
51  11 super.setUp();
52    }
53   
 
54  11 toggle protected void tearDown() throws Exception {
55  11 super.tearDown();
56    }
57   
 
58  51 toggle protected String[][] getTest() {
59  51 return test;
60    }
61   
 
62  11 toggle 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   
 
70  1 toggle public void testReadMaximalTerm00() throws Exception {
71  1 internalTest(0);
72    }
73   
 
74  1 toggle public void testReadMaximalTerm01() throws Exception {
75  1 internalTest(1);
76    }
77   
 
78  1 toggle public void testReadMaximalTerm02() throws Exception {
79  1 internalTest(2);
80    }
81   
 
82  1 toggle public void testReadMaximalTerm03() throws Exception {
83  1 internalTest(3);
84    }
85   
 
86  1 toggle public void testReadMaximalTerm04() throws Exception {
87  1 internalTest(4);
88    }
89   
 
90  1 toggle public void testReadMaximalTerm05() throws Exception {
91  1 internalTest(5);
92    }
93   
 
94  1 toggle public void testReadMaximalTerm06() throws Exception {
95  1 internalTest(6);
96    }
97   
 
98  1 toggle public void testReadMaximalTerm07() throws Exception {
99  1 internalTest(7);
100    }
101   
 
102  1 toggle public void testReadMaximalTerm08() throws Exception {
103  1 internalTest(8);
104    }
105   
 
106  1 toggle public void testReadMaximalTerm09() throws Exception {
107  1 internalTest(9);
108    }
109   
110    }