|
10 | 10 |
|
11 | 11 | import static org.variantsync.diffdetective.util.Assert.assertEquals; |
12 | 12 |
|
| 13 | +/** |
| 14 | + * Class containing tests of the parsing behaviour for the default implementation of PropositionalFormulaParser. |
| 15 | + * Goal: Special characters that occur in the output of a DiffLineFormulaExtractor must not confuse the parsing process of the PropositionalFormulaParser. |
| 16 | + * It is not designed to extensively test the functionality of the PropositionalFormulaParser itself as this is expected to be done by FeatureIDE already. |
| 17 | + * |
| 18 | + * @author Maximilian Glumann |
| 19 | + */ |
13 | 20 | public class PropositionalFormulaParserTest { |
14 | 21 | private record TestCase(String formula, Node expected) { |
15 | 22 | } |
16 | 23 |
|
17 | | - /* |
18 | | - * These testCases are based on a subset of the CPPParserTest testCases. |
19 | | - * It is not necessary to keep all testCases from CPPParserTest as most of them result in a single but long Literal anyway. |
20 | | - * The idea is to ensure that the PropositionalFormulaParser is not confused by any symbols in the output of CPPDiffLineFormulaExtractor. |
21 | | - * It is not designed to extensively test the functionality of the PropositionalFormulaParser itself as this is expected to be tested by FeatureIDE already. |
| 24 | + /** |
| 25 | + * These test cases are based on a subset of the CPPParserTest test cases. |
| 26 | + * It is not necessary to keep all test cases from CPPParserTest as most of them result in a single but long Literal anyway. |
22 | 27 | */ |
23 | 28 | private static List<TestCase> testCases() { |
24 | 29 | return List.of( |
@@ -59,9 +64,13 @@ private static List<TestCase> testCases() { |
59 | 64 | ); |
60 | 65 | } |
61 | 66 |
|
62 | | - /* |
63 | | - * A testCase is evaluated using syntactic equivalence between expectation and result because deterministic results are expected. |
64 | | - * Therefore, modifications in FeatureIDE might break these tests although the result remains semantically equivalent. |
| 67 | + /** |
| 68 | + * Each test case compares the output of the default PropositionalFormularParser to the expected output. |
| 69 | + * This comparison is performed using the equivalence defined by org.prop4j.Node from FeatureIDE. |
| 70 | + * Therefore, nodes describing equivalent propositional formulas in different tree structures are not considered equal. |
| 71 | + * As long as FeatureIDE produces a deterministic and consistent tree structure in its output, these tests will succeed. |
| 72 | + * Because DiffDetective desires not only a correct but also a deterministic and consistent parser output, |
| 73 | + * it is intended that these tests also break, if FeatureIDE changes its parsing behaviour in the future. |
65 | 74 | */ |
66 | 75 | @ParameterizedTest |
67 | 76 | @MethodSource("testCases") |
|
0 commit comments