diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2018-09-29 18:56:35 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2018-10-01 17:35:14 -0400 |
commit | 4c1366f389d8691a82db120e54a213747e0b4647 (patch) | |
tree | 15eed14e74ebf9e327dff67b9dba53e09836fa7f /test/librefetch-test.sh | |
parent | 84a73785021d83078ed722942cc7aac377deb13b (diff) |
test: Normalize on "status" instead of "stat" "ret" or "r" for storing exit codes
The name "status" was chosen because BATS initializes status=0; if we
switch from Roundup to BATS, our common setup won't need set it
anymore.
Accomplish this with:
$ sed -ri -e 's/\$(stat|ret|r)\b/$status/g' -e 's/\b(stat|ret|r)=/status=/g' test/*.sh
$ sed -ri '/^\s*(local\s+)?status=0$/d' test/*-test.sh
Diffstat (limited to 'test/librefetch-test.sh')
-rw-r--r-- | test/librefetch-test.sh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/librefetch-test.sh b/test/librefetch-test.sh index f3864f1..4052ce1 100644 --- a/test/librefetch-test.sh +++ b/test/librefetch-test.sh @@ -54,9 +54,9 @@ it_fails_with_bad_flags() { cd "$tmpdir" mv PKGBUILD{-mksource,} - librefetch --bogus-flag libre://"$srcball" >$tmpdir/stdout 2>$tmpdir/stderr || stat=$? + librefetch --bogus-flag libre://"$srcball" >$tmpdir/stdout 2>$tmpdir/stderr || status=$? - [[ $stat != 0 ]] + [[ $status != 0 ]] empty $tmpdir/stdout not empty $tmpdir/stderr not test -e $tmpdir/srcdest/$srcball |