Clover Coverage Report
Coverage timestamp: Fri May 24 2013 13:47:27 UTC
19   116   16   1.19
0   95   0.84   16
16     1  
1    
 
  LatexMathParserTest       Line # 10 19 16 94.3% 0.94285715
 
  (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.DummyInternalKernelServices;
8    import org.qedeq.kernel.xml.handler.parser.LoadXmlOperatorListUtility;
9   
 
10    public class LatexMathParserTest extends AbstractParserTestCase {
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 DummyInternalKernelServices(),
65    new File(getIndir(),
66    "parser/latexMathOperators.xml"));
67  11 final LatexMathParser result = new LatexMathParser();
68  11 result.setParameters(input, operators);
69  11 return result;
70    }
71   
 
72  1 toggle public void testReadMaximalTerm00() throws Exception {
73  1 internalTest(0);
74    }
75   
 
76  1 toggle public void testReadMaximalTerm01() throws Exception {
77  1 internalTest(1);
78    }
79   
 
80  1 toggle public void testReadMaximalTerm02() throws Exception {
81  1 internalTest(2);
82    }
83   
 
84  1 toggle public void testReadMaximalTerm03() throws Exception {
85  1 internalTest(3);
86    }
87   
 
88  1 toggle public void testReadMaximalTerm04() throws Exception {
89  1 internalTest(4);
90    }
91   
 
92  1 toggle public void testReadMaximalTerm05() throws Exception {
93  1 internalTest(5);
94    }
95   
 
96  1 toggle public void testReadMaximalTerm06() throws Exception {
97  1 internalTest(6);
98    }
99   
 
100  1 toggle public void testReadMaximalTerm07() throws Exception {
101  1 internalTest(7);
102    }
103   
 
104  1 toggle public void testReadMaximalTerm08() throws Exception {
105  1 internalTest(8);
106    }
107   
 
108  1 toggle public void testReadMaximalTerm09() throws Exception {
109  1 internalTest(9);
110    }
111   
 
112  0 toggle protected String[][] getExceptionTest() {
113  0 return null;
114    }
115   
116    }