[libcode-tidyall-perl] 189/374: test -p/--pipe

Jonas Smedegaard js at alioth.debian.org
Sun Sep 29 22:26:16 UTC 2013


This is an automated email from the git hooks/post-receive script.

js pushed a commit to branch master
in repository libcode-tidyall-perl.

commit af5f3331138bd0eca76295a4f8103049da0d634e
Author: Jonathan Swartz <swartz at pobox.com>
Date:   Thu Sep 6 11:14:42 2012 -0700

    test -p/--pipe
---
 lib/Code/TidyAll/t/Basic.pm |   13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/lib/Code/TidyAll/t/Basic.pm b/lib/Code/TidyAll/t/Basic.pm
index fa815d8..0ee65de 100644
--- a/lib/Code/TidyAll/t/Basic.pm
+++ b/lib/Code/TidyAll/t/Basic.pm
@@ -1,8 +1,8 @@
 package Code::TidyAll::t::Basic;
 use Cwd qw(realpath);
-use Code::TidyAll::Util qw(dirname mkpath read_file tempdir_simple write_file);
+use Code::TidyAll::Util qw(dirname mkpath pushd read_file tempdir_simple write_file);
 use Code::TidyAll;
-use Capture::Tiny qw(capture_stdout);
+use Capture::Tiny qw(capture capture_stdout);
 use File::Find qw(find);
 use Test::Class::Most parent => 'Code::TidyAll::Test::Class';
 
@@ -291,6 +291,15 @@ sub test_cli : Tests {
     };
     is( read_file("$root_dir/subdir/foo.txt"),  "BYEBYEBYE", "foo.txt tidied" );
     is( read_file("$root_dir/subdir/foo2.txt"), "bye",       "foo2.txt not tidied" );
+
+    # Test -p / --pipe
+    #
+    my ( $stdout, $stderr ) = capture {
+        open( my $fh, "|-", "$^X", "bin/tidyall", "-p", "$root_dir/does_not_exist/foo.txt" );
+        print $fh "echo";
+    };
+    is( $stdout, "ECHOECHOECHO", "pipe: stdin tidied" );
+    unlike( $stderr, qr/\S/, "pipe: no stderr" );
 }
 
 $conf1 = '

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libcode-tidyall-perl.git



More information about the Pkg-perl-cvs-commits mailing list