mirror of
https://github.com/mikefarah/yq.git
synced 2024-12-19 20:19:04 +00:00
Adding acceptance test for #1257, fixed panic
This commit is contained in:
parent
9b47a29864
commit
06d2aaad80
@ -331,4 +331,26 @@ EOM
|
||||
assertEquals "$expected" "$X"
|
||||
}
|
||||
|
||||
testBasicMultiplyAssignMultiDoc() {
|
||||
cat >test.yml <<EOL
|
||||
a: 1
|
||||
---
|
||||
b: 2
|
||||
EOL
|
||||
|
||||
read -r -d '' expected << EOM
|
||||
a: 1
|
||||
c: 3
|
||||
---
|
||||
b: 2
|
||||
c: 3
|
||||
EOM
|
||||
|
||||
|
||||
X=$(./yq '. *= {"c":3}' test.yml)
|
||||
assertEquals "$expected" "$X"
|
||||
}
|
||||
|
||||
|
||||
|
||||
source ./scripts/shunit2
|
@ -22,6 +22,8 @@ func assignUpdateOperator(d *dataTreeNavigator, context Context, expressionNode
|
||||
}
|
||||
|
||||
prefs := assignPreferences{}
|
||||
// they way *= (multipleAssign) is handled, we set the multiplePrefs
|
||||
// on the node, not assignPrefs. Long story.
|
||||
if p, ok := expressionNode.Operation.Preferences.(assignPreferences); ok {
|
||||
prefs = p
|
||||
}
|
||||
|
@ -1,3 +1,6 @@
|
||||
4.25.4:
|
||||
- Fixed panic when using multiply assign on multiple documents #1256 Thanks @care0717
|
||||
|
||||
4.25.3:
|
||||
- xml decoder now maintains namespaces by default. Use new flags to disable if required. Thanks @rndmit
|
||||
- Length and other similar operators no longer return comments (#1231)
|
||||
|
Loading…
Reference in New Issue
Block a user