From 54bc568f1f23d04b0082dee0e8ba9368541a8ebb Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 3 Jan 2019 11:35:57 +0100 Subject: [PATCH] Windows support: unlink file after it has been closed Otherwise install on Windows will fail with: t/parse_file.t .................. Error in tempfile() using template \XXXXXXXXXX.xhtml: Could not create temp file \WzBMoEw1MY.xhtml: Permission denied at t/parse_file.t line 10. # Looks like your test exited with 13 before it could output anything. t/parse_file.t .................. Dubious, test returned 13 (wstat 3328, 0xd00) --- t/parse_file.t | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/t/parse_file.t b/t/parse_file.t index 667f2c2..8f923a1 100644 --- a/t/parse_file.t +++ b/t/parse_file.t @@ -7,7 +7,7 @@ use Test::More tests => 1; use HTML::Lint; use File::Temp qw( tempfile ); -my ($o, $OUTPUT_FN) = tempfile( SUFFIX => '.xhtml', UNLINK => 1); +my ($o, $OUTPUT_FN) = tempfile( SUFFIX => '.xhtml', UNLINK => 0); print {$o} <<'EOF'; @@ -29,3 +29,5 @@ my $lint = HTML::Lint->new; $lint->parse_file($OUTPUT_FN); is_deeply( [map { $_->as_string() } $lint->errors()], [], 'HTML is valid for output file.' ); + +unlink($OUTPUT_FN);