mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
IDEA-19061 Integrate the Rearranger-plugin into core-IDE
Correct tree merge when single node is replaced
This commit is contained in:
+37
-5
@@ -80,9 +80,7 @@ four = '4'()
|
||||
'3'()}
|
||||
from = '4' {
|
||||
to = '5'()
|
||||
'6'()
|
||||
}
|
||||
|
||||
'6'()}
|
||||
}
|
||||
|
||||
// Modify.
|
||||
@@ -100,8 +98,42 @@ to = '5'()
|
||||
'3'()
|
||||
'5'()}
|
||||
'4' {
|
||||
'6'()
|
||||
}
|
||||
'6'()}
|
||||
}
|
||||
assertNodesEqual(expected, initial)
|
||||
checkRowMappings([:], rowMappings)
|
||||
}
|
||||
|
||||
@Test
|
||||
void replaceWithTwoLevelMergeToNodeAbove() {
|
||||
// Init.
|
||||
def node;
|
||||
def initial = new TreeNodeBuilder().
|
||||
'0' {
|
||||
'1'() {
|
||||
'2'()
|
||||
'3'()}
|
||||
node = '4'()
|
||||
'5'() {
|
||||
'6'()}
|
||||
}
|
||||
|
||||
// Modify.
|
||||
def replacement = new TreeNodeBuilder().
|
||||
'1' {
|
||||
'4'()
|
||||
}
|
||||
def rowMappings = doReplace(initial, node, node, replacement)
|
||||
|
||||
// Check.
|
||||
def expected = new TreeNodeBuilder().
|
||||
'0' {
|
||||
'1' {
|
||||
'2'()
|
||||
'3'()
|
||||
'4'()}
|
||||
'5' {
|
||||
'6'()}
|
||||
}
|
||||
assertNodesEqual(expected, initial)
|
||||
checkRowMappings([:], rowMappings)
|
||||
|
||||
Reference in New Issue
Block a user