GNU bug report logs -
#43616
[PATCH] tests: Simplify shell exit status negation;
Previous Next
Reported by: bavier <at> posteo.net
Date: Fri, 25 Sep 2020 18:01:01 UTC
Severity: normal
Tags: patch
Done: Eric Bavier <bavier <at> posteo.net>
Bug is archived. No further changes may be made.
Full log
Message #13 received at 43616-done <at> debbugs.gnu.org (full text, mbox):
On Sat, 2020-09-26 at 23:12 +0200, Ludovic Courtès wrote:
> Hi Eric,
>
> bavier <at> posteo.net skribis:
>
> > From: Eric Bavier <bavier <at> member.fsf.org>
> >
> > * tests/guix-archive.sh, tests/guix-build-branch.sh, tests/guix-
> > build.sh,
> > tests/guix-daemon.sh, tests/guix-download.sh, tests/guix-
> > environment.sh,
> > tests/guix-gc.sh, tests/guix-git-authenticate.sh, tests/guix-
> > graph.sh,
> > tests/guix-hash.sh, tests/guix-lint.sh, tests/guix-pack-
> > relocatable.sh,
> > tests/guix-pack.sh, tests/guix-package-aliases.sh, tests/guix-
> > package-net.sh,
> > tests/guix-package.sh: Use the shell '!' keyword to negate command
> > exit status
> > in place of 'if ...; then false; else true; fi'
>
> [...]
>
> > -if guix archive something-that-does-not-exist
> > -then false; else true; fi
> > +! guix archive something-that-does-not-exist
>
> I have a vague recollection that I came to the conclusion that the
> ‘if’
> was needed, but now I don’t see why.
>
> If you’re confident please go ahead! It’s never too late for me to
> improve my shell knowledge. :-)
I've used the same in other project test suites for a while now, and
have successfully run Guix's tests with this patch several times.
Pushed in d8934360d2453a403b5433e71d09188e4ed23b57
Thanks for the review,
`~Eric
This bug report was last modified 4 years and 287 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.