shellcheck

This commit is contained in:
Mike Farah 2021-07-18 17:05:12 +10:00
parent 7474ac62ef
commit 85bbbbeed4
5 changed files with 12 additions and 13 deletions

View File

@ -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

View File

@ -12,7 +12,7 @@ testEmptyEval() {
}
testEmptyEvalPipe() {
X=$(cat test.yml | ./yq e -)
X=$(./yq e - < test.yml)
assertEquals 0 $?
}

View File

@ -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"
}

View File

@ -5,6 +5,6 @@ for test in acceptance_tests/*.sh; do
echo "--------------------------------------------------------------"
echo "$test"
echo "--------------------------------------------------------------"
(exec $test);
(exec "$test");
done

View File

@ -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