When split expression includes an extension, dont add .yml automatically

This commit is contained in:
Mike Farah
2022-06-23 14:31:09 +10:00
parent f63d76f006
commit dfd396b480
3 changed files with 31 additions and 1 deletions
+25
View File
@@ -25,6 +25,31 @@ EOM
assertEquals "$expectedDoc2" "$doc2"
}
testBasicSplitWithNameCustomExtension() {
rm test*.yaml || true
cat >test.yml <<EOL
a: test_doc1
---
a: test_doc2
EOL
./yq e test.yml -s '.a + ".yaml"'
doc1=$(cat test_doc1.yaml)
assertEquals "a: test_doc1" "$doc1"
doc2=$(cat test_doc2.yaml)
read -r -d '' expectedDoc2 << EOM
---
a: test_doc2
EOM
assertEquals "$expectedDoc2" "$doc2"
}
testSplitFromFile() {
cat >test.yml <<EOL
a: test_doc1