Added more tests

This commit is contained in:
Mike Farah 2021-07-20 11:12:41 +10:00
parent 66b248ac18
commit b2380399a8

View File

@ -36,6 +36,33 @@ testLeadingSeperatorPipeIntoEvalSeq() {
assertEquals "$expected" "$X"
}
testLeadingSeperatorExtractField() {
X=$(./yq e '.a' - < test.yml)
assertEquals "test" "$X"
}
testLeadingSeperatorExtractFieldWithCommentsAfterSep() {
cat >test.yml <<EOL
---
# hi peeps
# cool
a: test
EOL
X=$(./yq e '.a' test.yml)
assertEquals "test" "$X"
}
testLeadingSeperatorExtractFieldWithCommentsBeforeSep() {
cat >test.yml <<EOL
# hi peeps
# cool
---
a: test
EOL
X=$(./yq e '.a' test.yml)
assertEquals "test" "$X"
}
testLeadingSeperatorEvalSeq() {
X=$(./yq e test.yml)