Make SDK tests use bash exit instead of return (#579)
* Use exit instead of return in bash scripts Return is to return from functions, not scripts. * Test scripts: exit 1 y files differ
This commit is contained in:
parent
1d8105af11
commit
97c0760a48
|
@ -7,10 +7,10 @@ input=$(cat "$1/input.json")
|
|||
|
||||
[ -f "$1/testOutput.txt" ] && rm "$1/testOutput.txt"
|
||||
|
||||
curl -sN --get -H "datastar-request" --data-urlencode "datastar=$input" "$2/test" -o "$1/testOutput.txt"
|
||||
curl -sN --get -H "datastar-request" --data-urlencode "datastar=$input" "$2/test" -o "$1/testOutput.txt"
|
||||
|
||||
[ ! -f "$1/testOutput.txt" ] && echo "case $1 failed: your server did not return anything" && return 1
|
||||
|
||||
diff -q "$1/testOutput.txt" "$1/output.txt"
|
||||
diff -q "$1/testOutput.txt" "$1/output.txt" || { exit 1; }
|
||||
|
||||
return 0
|
||||
exit 0
|
||||
|
|
|
@ -6,10 +6,10 @@
|
|||
[ -f "$1/testOutput.txt" ] && rm "$1/testOutput.txt"
|
||||
|
||||
input=$(cat "$1/input.json")
|
||||
curl -sN -H "datastar-request" --json "$input" "$2/test" -o "$1/testOutput.txt"
|
||||
curl -sN -H "datastar-request" --json "$input" "$2/test" -o "$1/testOutput.txt"
|
||||
|
||||
[ ! -f "$1/testOutput.txt" ] && echo "case $1 failed: your server did not return anything" && return 1
|
||||
|
||||
diff -q "$1/testOutput.txt" "$1/output.txt"
|
||||
diff -q "$1/testOutput.txt" "$1/output.txt" || { exit 1; }
|
||||
|
||||
return 0
|
||||
exit 0
|
||||
|
|
Loading…
Reference in New Issue