From 505cf3ea3c09b390a57c715e47b65fea764d726d Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 30 Sep 2013 12:06:49 -0400 Subject: test-common.sh: add an empty() routine to check if a file is empty, use it --- test/libremakepkg-test.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'test/libremakepkg-test.sh') diff --git a/test/libremakepkg-test.sh b/test/libremakepkg-test.sh index be19e17..2fb7f2f 100644 --- a/test/libremakepkg-test.sh +++ b/test/libremakepkg-test.sh @@ -47,7 +47,7 @@ it_displays_help_as_normal_user() { LANG=C libremakepkg -h >$tmpdir/stdout 2>$tmpdir/stderr [[ "$(sed 1q $tmpdir/stdout)" =~ Usage:.* ]] - [[ -z "$(cat $tmpdir/stderr)" ]] + empty $tmpdir/stderr } it_otherwise_fails_as_normal_user() { @@ -58,6 +58,6 @@ it_otherwise_fails_as_normal_user() { libremakepkg >$tmpdir/stdout 2>$tmpdir/stderr || stat=$? [[ $stat != 0 ]] - [[ -z "$(cat $tmpdir/stdout)" ]] - [[ -n "$(cat $tmpdir/stderr)" ]] + empty $tmpdir/stdout + ! empty $tmpdir/stderr } -- cgit v1.2.2