On Tue, Aug 21, 2018 at 2:46 PM Junio C Hamano <gits...@pobox.com> wrote:
>
> Stefan Beller <sbel...@google.com> writes:
>
> >> ...
> >> OTOH, if it were up to me I would have just gotten rid of
> >> test_must_be_empty and used an existing function with the right
> >> argument, like `test_cmp /dev/null` - but using some form consistently
> >> is the most important, whatever it is.
> >
> > /dev/null, eh? It shows you don't use Windows on a day to day basis. ;-)
> > But yeah consistency is really good to have. :)
>
> Just to make sure we don't give wrong impression to bystanders, do
> you mean that we should discourage using /dev/null in our tests or
> scripts due to portability concerns?

I would discourage reading /dev/null (as in `test_cmp /dev/null actual`)
over a more specific `test_must_be_empty` as that is easier to read.
(But I do neither en- or discourage the use of /dev/null in the implementation
of that function).

> I thought they had good enough emulation that writing /dev/null on
> the command line in scripts do what we expect the shell to do; the
> same thing can be said for calling open(2) on "/dev/null".

Oh, opening and reading is new to me, thanks!

> Back to the topic from the tangent, but there was a discussion on
> choosing between "test_must_be_empty actual" vs "test_cmp empty
> actual", and was even a proposal to trigger an error when an empty
> file is given to test_cmp.

Oh, that is an interesting way to ensure consistency.

>  You two might want to join the party
> there, perhaps?

I'll read into that.

Stefan

Reply via email to