diff --git a/acceptance_tests/basic.sh b/acceptance_tests/basic.sh index b43c8832..19640fd6 100755 --- a/acceptance_tests/basic.sh +++ b/acceptance_tests/basic.sh @@ -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 \ No newline at end of file diff --git a/acceptance_tests/empty.sh b/acceptance_tests/empty.sh index 119cf917..a88a6f4b 100755 --- a/acceptance_tests/empty.sh +++ b/acceptance_tests/empty.sh @@ -12,7 +12,7 @@ testEmptyEval() { } testEmptyEvalPipe() { - X=$(cat test.yml | ./yq e -) + X=$(./yq e - < test.yml) assertEquals 0 $? } diff --git a/acceptance_tests/leading-seperator.sh b/acceptance_tests/leading-seperator.sh index 273e6290..08c4582c 100755 --- a/acceptance_tests/leading-seperator.sh +++ b/acceptance_tests/leading-seperator.sh @@ -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" } diff --git a/scripts/acceptance.sh b/scripts/acceptance.sh index 708dc51c..7ec801fe 100755 --- a/scripts/acceptance.sh +++ b/scripts/acceptance.sh @@ -5,6 +5,6 @@ for test in acceptance_tests/*.sh; do echo "--------------------------------------------------------------" echo "$test" echo "--------------------------------------------------------------" - (exec $test); + (exec "$test"); done diff --git a/scripts/secure.sh b/scripts/secure.sh index 1a517fd2..956961dc 100755 --- a/scripts/secure.sh +++ b/scripts/secure.sh @@ -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 \ No newline at end of file