diff --git a/cmd/evaluate_all_command.go b/cmd/evaluate_all_command.go index 5bf24654..f2c8f0a0 100644 --- a/cmd/evaluate_all_command.go +++ b/cmd/evaluate_all_command.go @@ -73,7 +73,7 @@ func evaluateAll(cmd *cobra.Command, args []string) error { } case 1: if nullInput { - err = allAtOnceEvaluator.EvaluateFiles(args[0], []string{}, printer) + err = yqlib.NewStreamEvaluator().EvaluateNew(args[0], printer) } else { err = allAtOnceEvaluator.EvaluateFiles("", []string{args[0]}, printer) } diff --git a/scripts/acceptance.sh b/scripts/acceptance.sh index f41a288e..b543a8b3 100755 --- a/scripts/acceptance.sh +++ b/scripts/acceptance.sh @@ -6,6 +6,7 @@ set -e +echo "test eval-sequence" random=$((1 + $RANDOM % 10)) ./yq e -n ".a = $random" > test.yml X=$(./yq e '.a' test.yml) @@ -15,7 +16,9 @@ if [[ $X != $random ]]; then exit 1 fi -echo "created yaml successfully" +echo "--success" + +echo "test update-in-place" update=$(($random + 1)) ./yq e -i ".a = $update" test.yml @@ -26,24 +29,36 @@ if [[ $X != $update ]]; then exit 1 fi -echo "updated in place successfully" +echo "--success" -X=$(./yq e '.z' test.yml) -echo "no exit status success" +echo "test eval-all" +./yq ea -n ".a = $random" > test-eval-all.yml +Y=$(./yq ea '.a' test-eval-all.yml) +if [[ $Y != $random ]]; then + echo "Failed create with eval all: expected $random but was $X" + exit 1 +fi +echo "--success" + +echo "test no exit status" +./yq e '.z' test.yml +echo "--success" + +echo "test exit status" set +e -X=$(./yq e -e '.z' test.yml) +./yq e -e '.z' test.yml if [[ $? != 1 ]]; then echo "Expected error code 1 but was $?" exit 1 fi -echo "exit status success" +echo "--success" set -e rm test.yml - +rm test-eval-all.yml echo "acceptance tests passed"