From 30152b89b684eb3231ae4605215a412ed3a2e10e Mon Sep 17 00:00:00 2001 From: Packit Date: Sep 07 2020 12:05:11 +0000 Subject: Apply patch Convert-ASN1-0.27-Use-temporary-output-files-for-tests.patch patch_name: Convert-ASN1-0.27-Use-temporary-output-files-for-tests.patch present_in_specfile: true --- diff --git a/dist.ini b/dist.ini index 167e3e2..6f2fb12 100644 --- a/dist.ini +++ b/dist.ini @@ -23,6 +23,7 @@ directory = examples [PodVersion] [Prereqs / TestRequires] +File::Temp = 0 Test::More = 0.90 Math::BigInt = 1.997 diff --git a/t/07io.t b/t/07io.t index b4c0c58..bb1c804 100644 --- a/t/07io.t +++ b/t/07io.t @@ -2,6 +2,7 @@ use Convert::ASN1 qw(:io); use IO::Socket; +use File::Temp (); print "1..11\n"; @@ -14,11 +15,11 @@ my $result = pack("C*", 0x30, 0x3D, 0x04, 0x04, 0x46, 0x72, 0x65, 0x64, 0x73, 0x74, 0x04, 0x02, 0x6F, 0x66, 0x04, 0x07, 0x73, 0x74, 0x72, 0x69, 0x6E, 0x67, 0x73); -($file = $0) =~ s/t$/dat/; -open(OUT,"> $file"); -asn_write(*OUT, $result); -asn_write(*OUT, $result); -close(OUT); +$fd = File::Temp->new('UNLINK' => 0); +$file = $fd->filename; +asn_write($fd, $result); +asn_write($fd, $result); +$fd->close; open(IN,"< $file"); sysread(IN,$buffer,1024);