added tests for move-property in bpmodify am: 30751b313c
am: 8e5808e747
am: 9482312647
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/2182736 Change-Id: I24ba9bfbabea5f34ac0569730c8ebef41a4e5bc6 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
commit
a8a3411942
1 changed files with 43 additions and 0 deletions
|
@ -31,6 +31,8 @@ var testCases = []struct {
|
||||||
setString *string
|
setString *string
|
||||||
removeProperty bool
|
removeProperty bool
|
||||||
replaceProperty string
|
replaceProperty string
|
||||||
|
moveProperty bool
|
||||||
|
newLocation string
|
||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
name: "add",
|
name: "add",
|
||||||
|
@ -435,6 +437,45 @@ var testCases = []struct {
|
||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
replaceProperty: "foo:foo_lib,baz:baz_lib",
|
replaceProperty: "foo:foo_lib,baz:baz_lib",
|
||||||
|
}, {
|
||||||
|
name: "move contents of property into non-existing property",
|
||||||
|
input: `
|
||||||
|
cc_foo {
|
||||||
|
name: "foo",
|
||||||
|
bar: ["barContents"],
|
||||||
|
}
|
||||||
|
`,
|
||||||
|
output: `
|
||||||
|
cc_foo {
|
||||||
|
name: "foo",
|
||||||
|
baz: ["barContents"],
|
||||||
|
}
|
||||||
|
`,
|
||||||
|
property: "bar",
|
||||||
|
moveProperty: true,
|
||||||
|
newLocation: "baz",
|
||||||
|
}, {
|
||||||
|
name: "move contents of property into existing property",
|
||||||
|
input: `
|
||||||
|
cc_foo {
|
||||||
|
name: "foo",
|
||||||
|
baz: ["bazContents"],
|
||||||
|
bar: ["barContents"],
|
||||||
|
}
|
||||||
|
`,
|
||||||
|
output: `
|
||||||
|
cc_foo {
|
||||||
|
name: "foo",
|
||||||
|
baz: [
|
||||||
|
"bazContents",
|
||||||
|
"barContents",
|
||||||
|
],
|
||||||
|
|
||||||
|
}
|
||||||
|
`,
|
||||||
|
property: "bar",
|
||||||
|
moveProperty: true,
|
||||||
|
newLocation: "baz",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -452,6 +493,8 @@ func TestProcessModule(t *testing.T) {
|
||||||
addIdents.Set(testCase.addSet)
|
addIdents.Set(testCase.addSet)
|
||||||
removeIdents.Set(testCase.removeSet)
|
removeIdents.Set(testCase.removeSet)
|
||||||
removeProperty = &testCase.removeProperty
|
removeProperty = &testCase.removeProperty
|
||||||
|
moveProperty = &testCase.moveProperty
|
||||||
|
newLocation = testCase.newLocation
|
||||||
setString = testCase.setString
|
setString = testCase.setString
|
||||||
addLiteral = testCase.addLiteral
|
addLiteral = testCase.addLiteral
|
||||||
replaceProperty.Set(testCase.replaceProperty)
|
replaceProperty.Set(testCase.replaceProperty)
|
||||||
|
|
Loading…
Reference in a new issue