Adding acceptance test for #1257, fixed panic

This commit is contained in:
Mike Farah
2022-06-25 12:15:28 +10:00
parent 9b47a29864
commit 06d2aaad80
3 changed files with 27 additions and 0 deletions
+22
View File
@@ -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