mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 06:05:01 +07:00
IDEA-19061 Integrate the Rearranger-plugin into core-IDE
Correct tree merge when non-first rule should be merged down
This commit is contained in:
+34
@@ -139,6 +139,40 @@ node = '4'()
|
||||
checkRowMappings([:], rowMappings)
|
||||
}
|
||||
|
||||
@Test
|
||||
void replaceWithTwoLevelMergeToNodeBelow() {
|
||||
// Init.
|
||||
def from;
|
||||
def to;
|
||||
def initial = new TreeNodeBuilder().
|
||||
'0' {
|
||||
from = '1'() {
|
||||
'2'()
|
||||
to = '3'()}
|
||||
'4'() {
|
||||
'5'() }
|
||||
}
|
||||
|
||||
// Modify.
|
||||
def replacement = new TreeNodeBuilder().
|
||||
'4' {
|
||||
'3'()
|
||||
}
|
||||
def rowMappings = doReplace(initial, from, to, replacement)
|
||||
|
||||
// Check.
|
||||
def expected = new TreeNodeBuilder().
|
||||
'0' {
|
||||
'1' {
|
||||
'2'()}
|
||||
'4' {
|
||||
'3'()
|
||||
'5'()}
|
||||
}
|
||||
assertNodesEqual(expected, initial)
|
||||
checkRowMappings([:], rowMappings)
|
||||
}
|
||||
|
||||
@Test
|
||||
void addWithoutMergeAbove() {
|
||||
def initial = new TreeNodeBuilder().
|
||||
|
||||
Reference in New Issue
Block a user