Re: [PATCH 1/1] tests: replace `test -(d|f)` with test_path_is_(dir|file)
- From
Rohit Ashiwal <rohit.ashiwal265@gmail.com>
- Date
- Feb 26, 2019, 18:29 UTC
- Message-ID
- <CAL7ArXoau1ZfBsV9JaUDprwjSijyo6K5d9JyC1mdfc=KEvgJxw@mail.gmail.com>
- In-Reply-To
- <CAN0heSqSp-a0zUKT5EaGLBYnRtESTnu9GKWtGARz2kaOAhc1HQ@mail.gmail.com>
Hi Martin
On Tue, Feb 26, 2019 at 10:01 PM Martin Ågren <martin.agren@gmail.com> wrote:
Show 9 quoted lines
> > > - ! test -d submod && > > + ! test_path_is_dir submod && > > Now, here I wonder. This (and other changes like this) means that every > time the test passes, we see "Directory submod doesn't exist.", which is > perhaps not too irritating. But more importantly, when the test fails, > we don't get any hint. So a failure is just as silent and "non-helpful" > as before. I can think of a few approaches:
Show 5 quoted lines
> > 1 Teach `test_path_is_dir` and friends to handle "!" in a clever way, and > write these as `test_path_is_dir ! foo`. (We already have helpers > that do this, see, e.g., `test_i18ngrep`.) >
Yes, I also think that it should be corrected and I think this(1) approach is good as it resonates well with the existing code. I'll start working on it and submit the patch as soon as possible.
Thanks Rohit