[darcs-devel] darcs patch: During tests, do not exit silently when ... (and 2 more)

Florian Weimer fw at deneb.enyo.de
Tue Nov 8 04:35:01 PST 2005


* David Roundy:

>> Using the File::Temp module needs Perl 5.6.1.  Hopefully, this is okay.
>
> Will it exit with a nice error message if perl 5.6.1 isn't available? I
> see, actually 5.6.1 is pretty old (sarge has 5.8.4), so I think that's fine
> (although I trust someone will speak up if their system doesn't have perl
> 5.6.1).

It dies with a horrible error message. 8-) The use of File::Temp could
be moved to file scope, which should at least make things more
obvious.

Even FreeBSD 4.9 and Debian woody have Perl 5.6.1, so it should be
pretty safe.

>> +    my $superfluous = <$fh>;
>> +    unlink $filename;
>> +    die "darcs did not read all input\n" if $superfluous;
>
> Won't this fail to die if the superfluous file starts with a newline?

No, the <...> operator does not strip newlines, so it would return
"\n" in this case, a true value.

> I'm also wondering, does the test harness handle die properly
> (i.e. report it as an error)?

Good point.  No, not quite.  I don't know how to handle that yet.  I
can't call ok & friends because that would bump the test counter.  I'm
not aware of an interface which allows to flag the current test as
failing.

Shall I ask some Perl folks and submit an updated patch if there's a
reasonable solution?




More information about the darcs-devel mailing list