mirror of
https://github.com/mikefarah/yq.git
synced 2025-02-26 01:25:45 +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() {
|
testLeadingSeperatorEvalSeq() {
|
||||||
X=$(./yq e test.yml)
|
X=$(./yq e test.yml)
|
||||||
expected=$(cat test.yml)
|
expected=$(cat test.yml)
|
||||||
|
Loading…
Reference in New Issue
Block a user