mirror of
https://github.com/mikefarah/yq.git
synced 2025-01-24 14:45:39 +00:00
shellcheck
This commit is contained in:
parent
7474ac62ef
commit
85bbbbeed4
@ -5,10 +5,9 @@ setUp() {
|
||||
}
|
||||
|
||||
testBasicEvalRoundTrip() {
|
||||
random=$((1 + $RANDOM % 10))
|
||||
./yq e -n ".a = $random" > test.yml
|
||||
./yq e -n ".a = 123" > test.yml
|
||||
X=$(./yq e '.a' test.yml)
|
||||
assertEquals $random $X
|
||||
assertEquals 123 "$X"
|
||||
}
|
||||
|
||||
testBasicUpdateInPlaceSequence() {
|
||||
@ -17,7 +16,7 @@ a: 0
|
||||
EOL
|
||||
./yq e -i ".a = 10" test.yml
|
||||
X=$(./yq e '.a' test.yml)
|
||||
assertEquals "10" $X
|
||||
assertEquals "10" "$X"
|
||||
}
|
||||
|
||||
testBasicUpdateInPlaceSequenceEvalAll() {
|
||||
@ -26,19 +25,19 @@ a: 0
|
||||
EOL
|
||||
./yq ea -i ".a = 10" test.yml
|
||||
X=$(./yq e '.a' test.yml)
|
||||
assertEquals "10" $X
|
||||
assertEquals "10" "$X"
|
||||
}
|
||||
|
||||
testBasicNoExitStatus() {
|
||||
echo "a: cat" > test.yml
|
||||
X=$(./yq e '.z' test.yml)
|
||||
assertEquals "null" $X
|
||||
assertEquals "null" "$X"
|
||||
}
|
||||
|
||||
testBasicExitStatus() {
|
||||
echo "a: cat" > test.yml
|
||||
X=$(./yq e -e '.z' test.yml 2&>/dev/null)
|
||||
assertEquals 1 $?
|
||||
assertEquals 1 "$?"
|
||||
}
|
||||
|
||||
source ./scripts/shunit2
|
@ -12,7 +12,7 @@ testEmptyEval() {
|
||||
}
|
||||
|
||||
testEmptyEvalPipe() {
|
||||
X=$(cat test.yml | ./yq e -)
|
||||
X=$(./yq e - < test.yml)
|
||||
assertEquals 0 $?
|
||||
}
|
||||
|
||||
|
@ -8,7 +8,7 @@ EOL
|
||||
}
|
||||
|
||||
testLeadingSeperatorPipeIntoEvalSeq() {
|
||||
X=$(cat test.yml | ./yq e -)
|
||||
X=$(./yq e - < test.yml)
|
||||
expected=$(cat test.yml)
|
||||
assertEquals "$expected" "$X"
|
||||
}
|
||||
@ -21,7 +21,7 @@ testLeadingSeperatorEvalSeq() {
|
||||
}
|
||||
|
||||
testLeadingSeperatorPipeIntoEvalAll() {
|
||||
X=$(cat test.yml | ./yq ea -)
|
||||
X=$(./yq ea - < test.yml)
|
||||
expected=$(cat test.yml)
|
||||
assertEquals "$expected" "$X"
|
||||
}
|
||||
|
@ -5,6 +5,6 @@ for test in acceptance_tests/*.sh; do
|
||||
echo "--------------------------------------------------------------"
|
||||
echo "$test"
|
||||
echo "--------------------------------------------------------------"
|
||||
(exec $test);
|
||||
(exec "$test");
|
||||
done
|
||||
|
||||
|
@ -5,7 +5,7 @@ set -o pipefail
|
||||
|
||||
if command -v gosec &> /dev/null
|
||||
then
|
||||
gosec ${PWD} ./...
|
||||
gosec "${PWD}" ./...
|
||||
else
|
||||
./bin/gosec ${PWD} ./...
|
||||
./bin/gosec "${PWD}" ./...
|
||||
fi
|
Loading…
Reference in New Issue
Block a user