On Thu, Sep 09, 2004 at 12:28:27PM -0400, Jeff Urlwin wrote:
> Doh. Yes. Didn't think about File::Spec and devnull()...I learn something
> new every day. -- yet it seems that it's still not fast enough ;)
The patch would have been perfect[1] if it hadn't been wrapped by your mailer :)
Thanks.
Tim.
[1] "perfect" means I can apply it from my mail reader (mutt) by typing
| cd ~/dbi/trunk && patch -p0
> Jeff
>
> >
> > Could you rework that using File::Spec?
> >
>
> Index: t/01basics.t
> ===================================================================
> --- t/01basics.t (revision 452)
> +++ t/01basics.t (working copy)
> @@ -3,6 +3,7 @@
> use strict;
>
> use Test::More tests => 110;
> +use File::Spec;
>
> ##
> ----------------------------------------------------------------------------
> ## 01basic.t - test of some basic DBI functions
> @@ -147,10 +148,11 @@
> ## testing dbi_debug
>
> cmp_ok($DBI::dbi_debug, '==', 0, "... DBI::dbi_debug's initial state is
> 0");
> +my $null = File::Spec::->devnull();
>
> SKIP: {
> - skip "cannot find : /dev/null", 2 unless (-e "/dev/null");
> - DBI->trace(42,"/dev/null");
> + skip "cannot find : $null", 2 unless ($^O eq "MSWin32" || -e $null);
>
> + DBI->trace(42,$null);
> cmp_ok($DBI::dbi_debug, '==', 42, "... DBI::dbi_debug is 42");
> DBI->trace(0, undef);
> cmp_ok($DBI::dbi_debug, '==', 0, "... DBI::dbi_debug is 0");
>
>