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