add ut for preventing dropping null from arrays

Signed-off-by: pacoxu <paco.xu@daocloud.io>
This commit is contained in:
pacoxu 2021-06-04 13:46:19 +08:00
parent 6e0650e3e1
commit ceaf9b9d16

View File

@ -602,6 +602,57 @@ testCases:
- false
- b: 1
bar: 0
- description: patch array with nil
original:
foo:
- a: true
- null
- false
bar: []
drop:
- 1
modified:
foo:
- 1
- false
- b: 1
bar:
- c
- null
- null
- a
drop:
- null
current:
foo:
- a: true
- 2
- false
bar:
- c
- null
- null
- a
drop:
threeWay:
foo:
- 1
- false
- b: 1
drop:
- null
result:
foo:
- 1
- false
- b: 1
drop:
- null
bar:
- c
- null
- null
- a
`)
func TestCreateThreeWayJSONMergePatch(t *testing.T) {