summaryrefslogtreecommitdiff
path: root/t/05_mce_stream.t
diff options
context:
space:
mode:
authorFlorian Schlichting <fsfs@debian.org>2016-10-10 00:35:23 +0200
committerFlorian Schlichting <fsfs@debian.org>2016-10-10 00:35:23 +0200
commitba267b3d0c8e88a2a75119aad866b1672be03e0e (patch)
tree1fc8f82bdff348e05dca87451571599f3aec0227 /t/05_mce_stream.t
parent3897df415634aca61cfb1440972fcc7c6cdbfd0f (diff)
New upstream version 1.805
Diffstat (limited to 't/05_mce_stream.t')
-rw-r--r--[-rwxr-xr-x]t/05_mce_stream.t14
1 files changed, 9 insertions, 5 deletions
diff --git a/t/05_mce_stream.t b/t/05_mce_stream.t
index 572aa7d..8ed68c9 100755..100644
--- a/t/05_mce_stream.t
+++ b/t/05_mce_stream.t
@@ -3,9 +3,11 @@
use strict;
use warnings;
-use Test::More tests => 9;
+use Test::More;
-use MCE::Stream;
+BEGIN {
+ use_ok 'MCE::Stream';
+}
## preparation
@@ -44,7 +46,7 @@ is( join(' ', @a), $answers, 'array: check results for path' );
@a = mce_stream_f \&_task_b, \&_task_a, $fh_data;
is( join(' ', @a), $answers, 'array: check results for glob' );
-@a = mce_stream_s \&_task_b, \&_task_a, 1, 9, 1;
+@a = mce_stream_s \&_task_b, \&_task_a, 1, 9;
is( join(' ', @a), $answers, 'array: check results for sequence' );
seek($fh_data, $fh_pos, 0);
@@ -61,14 +63,14 @@ is( join(' ', @a), $answers, 'array_ref: check results for path' );
mce_stream_f \@a, \&_task_b, \&_task_a, $fh_data;
is( join(' ', @a), $answers, 'array_ref: check results for glob' );
-mce_stream_s \@a, \&_task_b, \&_task_a, 1, 9, 1;
+mce_stream_s \@a, \&_task_b, \&_task_a, 1, 9;
is( join(' ', @a), $answers, 'array_ref: check results for sequence' );
MCE::Stream::finish;
@a = mce_stream
{ mode => 'map', code => sub { $_ * 2 * 3 } },
- { mode => 'grep', code => sub { $_ % 3 == 0 } },
+ { mode => 'grep', code => sub { chomp; $_ % 3 == 0 } },
( 1..9 );
is( join(' ', @a), $ans_mix, 'array: check results for mix_mode' );
@@ -79,6 +81,8 @@ MCE::Stream::finish;
unlink $in_file;
+done_testing;
+
__DATA__
1
2