diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2013-09-30 12:06:49 -0400 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2013-09-30 12:07:44 -0400 |
commit | 505cf3ea3c09b390a57c715e47b65fea764d726d (patch) | |
tree | 1d6410c460e2df89fe64fe45e11df9dbbffbf647 /test/pkgbuild-check-nonfree-test.sh | |
parent | 3473a80a47f2cadc729f3be05fa7485ae5b12e22 (diff) |
test-common.sh: add an empty() routine to check if a file is empty, use it
Diffstat (limited to 'test/pkgbuild-check-nonfree-test.sh')
-rw-r--r-- | test/pkgbuild-check-nonfree-test.sh | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/test/pkgbuild-check-nonfree-test.sh b/test/pkgbuild-check-nonfree-test.sh index d547e24..80bfc47 100644 --- a/test/pkgbuild-check-nonfree-test.sh +++ b/test/pkgbuild-check-nonfree-test.sh @@ -30,31 +30,31 @@ it_displays_usage_text() { stat=$? [[ "$(sed 1q $tmpdir/stdout)" =~ Usage:.* ]] - [[ -z "$(cat $tmpdir/stderr)" ]] + empty $tmpdir/stderr [[ $stat == 0 ]] } it_succeeds_for_free_depends() { $pcn $pcn.d/PKGBUILD.free >$tmpdir/stdout 2>$tmpdir/stderr || stat=$? - [[ -z "$(cat $tmpdir/stdout)" ]] - [[ -n "$(cat $tmpdir/stderr)" ]] + empty $tmpdir/stdout + ! empty $tmpdir/stderr [[ $stat == 0 ]] } it_succeeds_for_nonfree_depend_with_replacement() { $pcn $pcn.d/PKGBUILD.nonfree-replacement >$tmpdir/stdout 2>$tmpdir/stderr || stat=$? - [[ -z "$(cat $tmpdir/stdout)" ]] - [[ -n "$(cat $tmpdir/stderr)" ]] + empty $tmpdir/stdout + ! empty $tmpdir/stderr [[ $stat == 0 ]] } it_fails_with_15_for_nonfree_depend() { $pcn $pcn.d/PKGBUILD.nonfree >$tmpdir/stdout 2>$tmpdir/stderr || stat=$? - [[ -z "$(cat $tmpdir/stdout)" ]] - [[ -n "$(cat $tmpdir/stderr)" ]] + empty $tmpdir/stdout + ! empty $tmpdir/stderr [[ $stat == 15 ]] } @@ -65,7 +65,7 @@ it_fails_when_there_is_no_blacklist() { $pcn $pcn.d/PKGBUILD.free >$tmpdir/stdout 2>$tmpdir/stderr || stat=$? - [[ -z "$(cat $tmpdir/stdout)" ]] - [[ -n "$(cat $tmpdir/stderr)" ]] + empty $tmpdir/stdout + ! empty $tmpdir/stderr [[ $stat != 0 ]] && [[ $stat != 15 ]] } |