mirror of
https://github.com/mikefarah/yq.git
synced 2024-11-12 13:48:06 +00:00
Added more tests
This commit is contained in:
parent
b2380399a8
commit
9ec20f8ba2
@ -64,6 +64,46 @@ EOL
|
||||
}
|
||||
|
||||
|
||||
testLeadingSeperatorExtractFieldMultiDoc() {
|
||||
cat >test.yml <<EOL
|
||||
---
|
||||
a: test
|
||||
---
|
||||
a: test2
|
||||
EOL
|
||||
|
||||
read -r -d '' expected << EOM
|
||||
test
|
||||
---
|
||||
test2
|
||||
EOM
|
||||
X=$(./yq e '.a' test.yml)
|
||||
assertEquals "$expected" "$X"
|
||||
}
|
||||
|
||||
testLeadingSeperatorExtractFieldMultiDocWithComments() {
|
||||
cat >test.yml <<EOL
|
||||
# here
|
||||
---
|
||||
# there
|
||||
a: test
|
||||
# whereever
|
||||
---
|
||||
# you are
|
||||
a: test2
|
||||
# woop
|
||||
EOL
|
||||
|
||||
read -r -d '' expected << EOM
|
||||
test
|
||||
---
|
||||
test2
|
||||
EOM
|
||||
X=$(./yq e '.a' test.yml)
|
||||
assertEquals "$expected" "$X"
|
||||
}
|
||||
|
||||
|
||||
testLeadingSeperatorEvalSeq() {
|
||||
X=$(./yq e test.yml)
|
||||
expected=$(cat test.yml)
|
||||
|
Loading…
Reference in New Issue
Block a user