[libyaml-libyaml-perl] 02/11: Clean up the io-handle.t test
gregor herrmann
gregoa at debian.org
Fri Mar 18 18:03:31 UTC 2016
This is an automated email from the git hooks/post-receive script.
gregoa pushed a commit to branch gregoa/use-system-yaml
in repository libyaml-libyaml-perl.
commit b2d3e1cd741b4eeb0d07eb78f7f4517afaa1ba03
Author: Ingy döt Net <ingy at ingy.net>
Date: Wed Feb 10 10:48:21 2016 -0500
Clean up the io-handle.t test
---
{t => test}/io-handle.t | 25 +++++++++++--------------
1 file changed, 11 insertions(+), 14 deletions(-)
diff --git a/t/io-handle.t b/test/io-handle.t
similarity index 70%
rename from t/io-handle.t
rename to test/io-handle.t
index 8b385df..4151ab4 100644
--- a/t/io-handle.t
+++ b/test/io-handle.t
@@ -3,15 +3,10 @@ use lib -e 't' ? 't' : 'test';
my $t = -e 't' ? 't' : 'test';
use utf8;
-use lib 'inc';
-BEGIN {
- @Test::YAML::EXPORT =
- grep { not /^(Dump|Load)(File)?$/ } @Test::YAML::EXPORT;
-}
use IO::Pipe;
use IO::File;
use t::TestYAML tests => 6;
-use YAML qw/DumpFile LoadFile/;;
+use YAML::XS qw/DumpFile LoadFile/;;
my $testdata = 'El país es medible. La patria es del tamaño del corazón de quien la quiere.';
@@ -21,14 +16,14 @@ my $testdata = 'El país es medible. La patria es del tamaño del corazón de qu
my $pipe = new IO::Pipe;
if ( fork() ) { # parent reads from IO::Pipe handle
- $pipe->reader();
- my $recv_data = LoadFile($pipe);
- is length($recv_data), length($testdata), 'LoadFile from IO::Pipe read data';
- is $recv_data, $testdata, 'LoadFile from IO::Pipe contents is correct';
+ $pipe->reader();
+ my $recv_data = LoadFile($pipe);
+ is length($recv_data), length($testdata), 'LoadFile from IO::Pipe read data';
+ is $recv_data, $testdata, 'LoadFile from IO::Pipe contents is correct';
} else { # child writes to IO::Pipe handle
- $pipe->writer();
- DumpFile($pipe, $testdata);
- exit 0;
+ $pipe->writer();
+ DumpFile($pipe, $testdata);
+ exit 0;
}
# IO::File
@@ -54,4 +49,6 @@ $fh->close;
is length($read_data), length($testdata), 'LoadFile from IO::File read data';
is $read_data, $testdata, 'LoadFile from IO::File read data';
-unlink $file;
+END {
+ unlink $file;
+}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libyaml-libyaml-perl.git
More information about the Pkg-perl-cvs-commits
mailing list