mirror of
https://github.com/sigmasternchen/xtext-core
synced 2025-03-15 08:18:55 +00:00
fixed test cases concerning identical paths and nested prefix paths
This commit is contained in:
parent
2726ec0e09
commit
36f790b37b
1 changed files with 7 additions and 6 deletions
|
@ -637,7 +637,7 @@ public class HoistingProcessorTest extends AbstractXtextTests {
|
|||
HoistingGuard guard = hoistingProcessor.findHoistingGuard(rule.getAlternatives());
|
||||
assertFalse(guard.isTrivial());
|
||||
assertTrue(guard.hasTerminal());
|
||||
assertEquals("((" + getSyntaxForKeywordToken("j", 10) + " || ((p0) || (p1))) && (" + getSyntaxForKeywordToken("k", 10) + " || (p2)))", guard.render());
|
||||
assertEquals("((" + getSyntaxForKeywordToken("j", 10) + " || (p0) || (p1)) && (" + getSyntaxForKeywordToken("k", 10) + " || (p2)))", guard.render());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -658,7 +658,7 @@ public class HoistingProcessorTest extends AbstractXtextTests {
|
|||
HoistingGuard guard = hoistingProcessor.findHoistingGuard(rule.getAlternatives());
|
||||
assertFalse(guard.isTrivial());
|
||||
assertTrue(guard.hasTerminal());
|
||||
assertEquals("((" + getSyntaxForKeywordToken("a", 1) + " || ((p0) || (p1))) && (" + getSyntaxForKeywordToken("b", 1) + " || (p2)))", guard.render());
|
||||
assertEquals("((" + getSyntaxForKeywordToken("a", 1) + " || (p0) || (p1)) && (" + getSyntaxForKeywordToken("b", 1) + " || (p2)))", guard.render());
|
||||
|
||||
// number of elements in Alternatives object has to stay the same
|
||||
// even though the identical paths are collapsed during the hoisting process
|
||||
|
@ -924,11 +924,12 @@ public class HoistingProcessorTest extends AbstractXtextTests {
|
|||
HoistingGuard guard = hoistingProcessor.findHoistingGuard(rule.getAlternatives());
|
||||
assertFalse(guard.isTrivial());
|
||||
assertTrue(guard.hasTerminal());
|
||||
System.out.println(guard.render());
|
||||
System.out.println(guard.toString());
|
||||
assertEquals(
|
||||
"(" +
|
||||
"(" + getSyntaxForKeywordToken("a", 1) + " || (" + getSyntaxForEofToken(2) + " && " + getSyntaxForKeywordToken("b", 2) + ") || (p0)) && " +
|
||||
"(" + getSyntaxForKeywordToken("a", 1) + " || (" + getSyntaxForEofToken(2) + " && " + getSyntaxForKeywordToken("c", 2) + ") || (p1)) && " +
|
||||
"(" + getSyntaxForKeywordToken("a", 1) + " || " + getSyntaxForEofToken(2) + " || (p0) || (p1)) && " +
|
||||
"(" + getSyntaxForKeywordToken("b", 2) + " || (p0)) && " +
|
||||
"(" + getSyntaxForKeywordToken("c", 2) + " || (p1)) && " +
|
||||
"(" + getSyntaxForKeywordToken("d", 1) + " || (p2))" +
|
||||
")",
|
||||
guard.render()
|
||||
|
|
Loading…
Reference in a new issue