diff options
Diffstat (limited to 'test/librechroot-test.sh')
-rw-r--r-- | test/librechroot-test.sh | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/test/librechroot-test.sh b/test/librechroot-test.sh index 76afb56..90d0adc 100644 --- a/test/librechroot-test.sh +++ b/test/librechroot-test.sh @@ -36,22 +36,22 @@ it_displays_help_as_normal_user() { LANG=C librechroot help >$tmpdir/stdout 2>$tmpdir/stderr [[ "$(sed 1q $tmpdir/stdout)" =~ Usage:.* ]] - [[ -z "$(cat $tmpdir/stderr)" ]] + empty $tmpdir/stderr } it_otherwise_fails_as_normal_user() { librechroot run true >$tmpdir/stdout 2>$tmpdir/stderr || stat=$? [[ $stat != 0 ]] - [[ -z "$(cat $tmpdir/stdout)" ]] - [[ -n "$(cat $tmpdir/stderr)" ]] + empty $tmpdir/stdout + ! empty $tmpdir/stderr } it_displays_help_and_fails_with_0_args() { LANG=C librechroot >$tmpdir/stdout 2>$tmpdir/stderr || stat=$? [[ $stat != 0 ]] - [[ -z "$(cat $tmpdir/stdout)" ]] + empty $tmpdir/stdout [[ "$(sed 1q $tmpdir/stderr)" =~ Usage:.* ]] } @@ -61,8 +61,8 @@ it_fails_for_unknown_commands() { testsudo librechroot phony >$tmpdir/stdout 2>$tmpdir/stderr || stat=$? [[ $stat != 0 ]] - [[ -z "$(cat $tmpdir/stdout)" ]] - [[ -n "$(cat $tmpdir/stderr)" ]] + empty $tmpdir/stdout + ! empty $tmpdir/stderr } # requires sudo so we know it's not failing because it needs root @@ -71,6 +71,6 @@ it_fails_for_unknown_flags() { testsudo librechroot -q >$tmpdir/stdout 2>$tmpdir/stderr || stat=$? [[ $stat != 0 ]] - [[ -z "$(cat $tmpdir/stdout)" ]] - [[ -n "$(cat $tmpdir/stderr)" ]] + empty $tmpdir/stdout + ! empty $tmpdir/stderr } |