mirror of
https://github.com/mikefarah/yq.git
synced 2026-08-24 00:04:50 +08:00
Added expression argument to forcibly set expression if required
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
setUp() {
|
||||
rm test*.yml || true
|
||||
rm .xyz -f
|
||||
}
|
||||
|
||||
testBasicEvalRoundTrip() {
|
||||
@@ -16,6 +17,18 @@ testBasicPipeWithDot() {
|
||||
assertEquals "a: 123" "$X"
|
||||
}
|
||||
|
||||
testBasicExpressionMatchesFileName() {
|
||||
./yq -n ".xyz = 123" > test.yml
|
||||
touch .xyz
|
||||
|
||||
X=$(./yq --expression '.xyz' test.yml)
|
||||
assertEquals "123" "$X"
|
||||
|
||||
X=$(./yq ea --expression '.xyz' test.yml)
|
||||
assertEquals "123" "$X"
|
||||
|
||||
}
|
||||
|
||||
testBasicGitHubAction() {
|
||||
./yq -n ".a = 123" > test.yml
|
||||
X=$(cat /dev/null | ./yq test.yml)
|
||||
|
||||
Reference in New Issue
Block a user