diff options
author | Guillem Jover <guillem@debian.org> | 2013-01-03 00:11:24 +0100 |
---|---|---|
committer | Guillem Jover <guillem@debian.org> | 2013-05-08 04:50:19 +0200 |
commit | 05f9f4b00a2675c346b6e6fe025254dfe5d64ad5 (patch) | |
tree | 2b253fdf1e09555d2a44af6fd896e0851bc8a56e /src/t | |
parent | a4c8c4b56b11038e3d1cb8d312fe149e9c3d1384 (diff) | |
download | dpkg-05f9f4b00a2675c346b6e6fe025254dfe5d64ad5.tar.gz |
perl: Slurp files more efficiently
Do not read each line to then join it, just switch on slurp mode and
do it in one go. Use the newly created function file_slurp.
Fixes InputOutput::ProhibitJoinedReadline.
Warned-by: perlcritic
Diffstat (limited to 'src/t')
-rw-r--r-- | src/t/100_dpkg_divert.t | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/t/100_dpkg_divert.t b/src/t/100_dpkg_divert.t index 40af7a9f8..2e798075f 100644 --- a/src/t/100_dpkg_divert.t +++ b/src/t/100_dpkg_divert.t @@ -15,6 +15,7 @@ use Test::More; use File::Spec; +use Dpkg::File; use Dpkg::IPC; use strict; @@ -97,13 +98,13 @@ sub call { is(join('', @output), join('', @expect), "@$args stdout"); } if (defined $opts{expect_stdout_like}) { - like(join('', <$output>), $opts{expect_stdout_like}, "@$args stdout"); + like(file_slurp($output), $opts{expect_stdout_like}, "@$args stdout"); } if (defined $opts{expect_stderr}) { - is(join('', <$error>), $opts{expect_stderr}, "@$args stderr"); + is(file_slurp($error), $opts{expect_stderr}, "@$args stderr"); } if (defined $opts{expect_stderr_like}) { - like(join('', <$error>), $opts{expect_stderr_like}, "@$args stderr"); + like(file_slurp($error), $opts{expect_stderr_like}, "@$args stderr"); } close($output); |