Skip to content

Commit 4ab8d21

Browse files
clarified documentation comments
1 parent 67e798c commit 4ab8d21

1 file changed

Lines changed: 17 additions & 8 deletions

File tree

src/test/java/PropositionalFormulaParserTest.java

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,20 @@
1010

1111
import static org.variantsync.diffdetective.util.Assert.assertEquals;
1212

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+
*/
1320
public class PropositionalFormulaParserTest {
1421
private record TestCase(String formula, Node expected) {
1522
}
1623

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.
2227
*/
2328
private static List<TestCase> testCases() {
2429
return List.of(
@@ -59,9 +64,13 @@ private static List<TestCase> testCases() {
5964
);
6065
}
6166

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.
6574
*/
6675
@ParameterizedTest
6776
@MethodSource("testCases")

0 commit comments

Comments
 (0)