Subject: | [PATCH] t/autotie.t fails on Strawberry 5.16 due to path separator |
Date: | Fri, 18 Oct 2013 12:25:18 -0400 |
To: | bug-IO-All [...] rt.cpan.org |
From: | Mike Small <smallm [...] panix.com> |
Installing IO-All-0.48 using Strawberry Perl 5.16.3.1-32bit on Windows 7
fails with the following error:
t/autotie.t ............. 1/5 # Failed test at t/autotie.t line 12.
# got: 't\mystuff'
# expected: 't/mystuff'
# Looks like you failed 1 test of 5.
t/autotie.t ............. Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/5 subtests
Would the attached patch make sense? It avoids the error for me.
Regards,
Mike
--- t/autotie.t.orig Tue Oct 8 14:48:28 2013
+++ t/autotie.t Fri Oct 18 11:56:17 2013
@@ -1,15 +1,17 @@
use lib 't', 'lib';
use strict;
use warnings;
+use File::Spec::Functions;
use Test::More;
use IO::All;
use IO_All_Test;
-my @lines = read_file_lines('t/mystuff');
+my $f = catfile('t', 'mystuff');
+my @lines = read_file_lines($f);
plan(tests => 1 + @lines + 1);
-my $io = io('t/mystuff')->tie;
-is($io->autoclose(0) . '', 't/mystuff');
+my $io = io($f)->tie;
+is($io->autoclose(0) . '', $f);
while (<$io>) {
is($_, shift @lines);
}