Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package perl-Test-Output for openSUSE:Factory checked in at 2021-02-04 20:22:23 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/perl-Test-Output (Old) and /work/SRC/openSUSE:Factory/.perl-Test-Output.new.28504 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Test-Output" Thu Feb 4 20:22:23 2021 rev:19 rq:868331 version:1.032 Changes: -------- --- /work/SRC/openSUSE:Factory/perl-Test-Output/perl-Test-Output.changes 2017-04-11 09:36:38.301335659 +0200 +++ /work/SRC/openSUSE:Factory/.perl-Test-Output.new.28504/perl-Test-Output.changes 2021-02-04 20:22:40.686698729 +0100 @@ -1,0 +2,6 @@ +Fri Jan 29 03:10:01 UTC 2021 - Tina M??ller <timueller+p...@suse.de> + +- updated to 1.032 + see /usr/share/doc/packages/perl-Test-Output/Changes + +------------------------------------------------------------------- Old: ---- Test-Output-1.031.tar.gz New: ---- Test-Output-1.032.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-Test-Output.spec ++++++ --- /var/tmp/diff_new_pack.vEenLl/_old 2021-02-04 20:22:41.174699472 +0100 +++ /var/tmp/diff_new_pack.vEenLl/_new 2021-02-04 20:22:41.178699478 +0100 @@ -1,7 +1,7 @@ # # spec file for package perl-Test-Output # -# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -12,48 +12,53 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ # +%define cpan_name Test-Output Name: perl-Test-Output -Version: 1.031 +Version: 1.032 Release: 0 -%define cpan_name Test-Output Summary: Utilities to test STDOUT and STDERR messages -License: Artistic-1.0 or GPL-1.0+ -Group: Development/Libraries/Perl -Url: http://search.cpan.org/dist/Test-Output/ +License: Artistic-2.0 +URL: https://metacpan.org/release/%{cpan_name} Source0: https://cpan.metacpan.org/authors/id/B/BD/BDFOY/%{cpan_name}-%{version}.tar.gz Source1: cpanspec.yml BuildArch: noarch -BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: perl BuildRequires: perl-macros BuildRequires: perl(Capture::Tiny) >= 0.17 BuildRequires: perl(File::Temp) >= 0.17 +BuildRequires: perl(Sub::Exporter) +BuildRequires: perl(Test::More) >= 1 BuildRequires: perl(Test::Tester) >= 0.107 Requires: perl(Capture::Tiny) >= 0.17 Requires: perl(File::Temp) >= 0.17 +Requires: perl(Sub::Exporter) %{perl_requires} %description -Test::Output provides a simple interface for testing output sent to -'STDOUT' or 'STDERR'. A number of different utilities are included to try -and be as flexible as possible to the tester. +Test::Output provides a simple interface for testing output sent to STDOUT +or STDERR. A number of different utilities are included to try and be as +flexible as possible to the tester. + +Originally this module was designed not to have external requirements, +however, the features provided by Sub::Exporter over what Exporter provides +is just to great to pass up. Likewise, Capture::Tiny provides a much more robust capture mechanism without than the original Test::Output::Tie. %prep -%setup -q -n %{cpan_name}-%{version} +%autosetup -n %{cpan_name}-%{version} %build -%{__perl} Makefile.PL INSTALLDIRS=vendor -%{__make} %{?_smp_mflags} +perl Makefile.PL INSTALLDIRS=vendor +%make_build %check -%{__make} test +make test %install %perl_make_install @@ -61,7 +66,6 @@ %perl_gen_filelist %files -f %{name}.files -%defattr(-,root,root,755) %doc Changes %license LICENSE ++++++ Test-Output-1.031.tar.gz -> Test-Output-1.032.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Output-1.031/Changes new/Test-Output-1.032/Changes --- old/Test-Output-1.031/Changes 2017-03-29 23:32:14.000000000 +0200 +++ new/Test-Output-1.032/Changes 2021-01-28 23:15:14.000000000 +0100 @@ -1,17 +1,11 @@ Revision history for Perl module Test::Output -1.031 2017-03-29T21:30:57Z - * Get rid of Sub::Exporter. That module has nice features that this - module doesn't use and the prereq is causing problems with CPAN - Testers. CPAN Grep didn't show anyone using advanced features for - exports. +1.032 2021-01-28T22:15:07Z + * Fix cut-n-paste error in docs (Github #6, hexcoder) 1.03 - 2014-01-03 * Get rid of MYMETA -1.02_01 - 2013-12-17 - * Get rid of MYMETA - 1.02 - 2013-07-08 * Bump to stable release diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Output-1.031/MANIFEST.SKIP new/Test-Output-1.032/MANIFEST.SKIP --- old/Test-Output-1.031/MANIFEST.SKIP 2017-03-29 23:32:14.000000000 +0200 +++ new/Test-Output-1.032/MANIFEST.SKIP 2021-01-28 23:15:14.000000000 +0100 @@ -57,7 +57,13 @@ ^MYMETA\. #!end included /usr/local/perls/perl-5.18.1/lib/5.18.1/ExtUtils/MANIFEST.SKIP -\.travis\.yml +\.?appveyor.yml \.releaserc +\.lwpcookies Test-.* TODO +\bMANIFEST\s\d +\bChanges\s\d +\.icloud$ +\A\.github\b + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Output-1.031/META.json new/Test-Output-1.032/META.json --- old/Test-Output-1.031/META.json 2017-03-29 23:32:31.000000000 +0200 +++ new/Test-Output-1.032/META.json 2021-01-28 23:15:17.000000000 +0100 @@ -4,18 +4,18 @@ "brian d foy <bd...@cpan.org>" ], "dynamic_config" : 1, - "generated_by" : "ExtUtils::MakeMaker version 7.04, CPAN::Meta::Converter version 2.140640", + "generated_by" : "ExtUtils::MakeMaker version 7.34, CPAN::Meta::Converter version 2.150010", "keywords" : [ "testing", "STDOUT", "STDERR" ], "license" : [ - "perl_5" + "artistic_2" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", - "version" : "2" + "version" : 2 }, "name" : "Test-Output", "no_index" : { @@ -38,12 +38,13 @@ "requires" : { "Capture::Tiny" : "0.17", "File::Temp" : "0.17", + "Sub::Exporter" : "0", "perl" : "5.008" } }, "test" : { "requires" : { - "Test::More" : "0", + "Test::More" : "1", "Test::Tester" : "0.107" } } @@ -60,5 +61,6 @@ "web" : "https://github.com/briandfoy/test-output" } }, - "version" : "1.031" + "version" : "1.032", + "x_serialization_backend" : "JSON::PP version 4.02" } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Output-1.031/META.yml new/Test-Output-1.032/META.yml --- old/Test-Output-1.031/META.yml 2017-03-29 23:32:29.000000000 +0200 +++ new/Test-Output-1.032/META.yml 2021-01-28 23:15:16.000000000 +0100 @@ -3,18 +3,18 @@ author: - 'brian d foy <bd...@cpan.org>' build_requires: - Test::More: '0' + Test::More: '1' Test::Tester: '0.107' configure_requires: ExtUtils::MakeMaker: '6.64' File::Spec::Functions: '0' dynamic_config: 1 -generated_by: 'ExtUtils::MakeMaker version 7.04, CPAN::Meta::Converter version 2.140640' +generated_by: 'ExtUtils::MakeMaker version 7.34, CPAN::Meta::Converter version 2.150010' keywords: - testing - STDOUT - STDERR -license: perl +license: artistic_2 meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' @@ -26,9 +26,11 @@ requires: Capture::Tiny: '0.17' File::Temp: '0.17' + Sub::Exporter: '0' perl: '5.008' resources: bugtracker: https://github.com/briandfoy/test-output/issues homepage: https://github.com/briandfoy/test-output repository: https://github.com/briandfoy/test-output.git -version: '1.031' +version: '1.032' +x_serialization_backend: 'CPAN::Meta::YAML version 0.018' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Output-1.031/Makefile.PL new/Test-Output-1.032/Makefile.PL --- old/Test-Output-1.031/Makefile.PL 2017-03-29 23:32:14.000000000 +0200 +++ new/Test-Output-1.032/Makefile.PL 2021-01-28 23:15:14.000000000 +0100 @@ -50,7 +50,7 @@ 'AUTHOR' => 'brian d foy <bd...@cpan.org>', 'ABSTRACT_FROM' => $main_file, 'VERSION_FROM' => $main_file, - 'LICENSE' => 'perl', + 'LICENSE' => 'artistic_2', 'CONFIGURE_REQUIRES' => { 'ExtUtils::MakeMaker' => '6.64', @@ -61,12 +61,12 @@ }, 'TEST_REQUIRES' => { - 'Test::More' => '0.94', + 'Test::More' => '1', 'Test::Tester' => '0.107', - 'Test::More' => '0', }, 'PREREQ_PM' => { + 'Sub::Exporter' => '0', 'File::Temp' => '0.17', # needs :seekable 'Capture::Tiny' => '0.17', }, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Output-1.031/README.pod new/Test-Output-1.032/README.pod --- old/Test-Output-1.031/README.pod 2017-03-29 23:32:14.000000000 +0200 +++ new/Test-Output-1.032/README.pod 2021-01-28 23:15:14.000000000 +0100 @@ -2,18 +2,32 @@ =encoding utf8 +=for HTML <a href="../../actions?query=workflow%3Amacos"><img src="../../workflows/macos/badge.svg"></a> + +=for HTML <a href="../../actions?query=workflow%3Aubuntu"><img src="../../workflows/ubuntu/badge.svg"></a> + +=for HTML <a href="../../actions?query=workflow%3Awindows"><img src="../../workflows/windows/badge.svg"></a> + +=for HTML <a href='https://ci.appveyor.com/project/briandfoy/test-output'><img src='https://ci.appveyor.com/api/projects/status/glh33tppq1a9aoyk' /></a> + +=for HTML <a href='https://coveralls.io/github/briandfoy/test-output?branch=master'><img src='https://coveralls.io/repos/github/briandfoy/test-output/badge.svg?branch=master' alt='Coverage Status' /></a> + +=for HTML <a href="https://github.com/briandfoy/test-output/blob/master/LICENSE"><img src="https://img.shields.io/cpan/l/Test-Output.svg" /></a> + +=for HTML <a href="https://metacpan.org/pod/Test::Output"><img src="https://img.shields.io/cpan/v/Test-Output.svg" /></A> + =head1 The Test::Output module -This is the I<README> for the L<Test::Output> Perl module. You're probably +This is the I<README> for the L<Test::Output> Perl module. You're probably looking at this because you don't know where else to find what you're -looking for. Read this once and you might never have to read one again +looking for. Read this once and you might never have to read one again for any Perl module. =head2 Documentation -To read about L<Test::Output>, look at the embedded documentation -in the module itself. Inside the distribution, you can format it -with L<perldoc|http://perldoc.perl.org/perldoc.html>: +To read about L<Test::Output>, look at the embedded documentation +in the module itself. Inside the distribution, you can format it +with L<perldoc|https://perldoc.perl.orgperldoc.html>: % perldoc lib/Test/Output.pm @@ -22,17 +36,8 @@ % perldoc Test::Output -You can read the documentation and inspect the meta data on one of the -CPAN web interfaces, such as L<CPAN Search|http://search.cpan.org/dist/Test-Output> or -L<MetaCPAN|http://www.metacpan.org/module/Test::Output>: - -=over 4 - -=item * L<http://search.cpan.org/dist/Test-Output> - -=item * L<http://www.metacpan.org/module/Test::Output> - -=back +You can read the documentation and inspect the meta data at +L<MetaCPAN|https://metacpan.org/pod/Test::Output>. The standard module documentation has example uses in the SYNOPSIS section, but you can also look in the I<examples/> directory (if it's @@ -59,11 +64,11 @@ % make test % make install -You probably don't want to do that unless you're fiddling with the +You probably don't want to do that unless you're fiddling with the module and only want to run the tests without installing anything. =head2 Source location - + The meta data, such as the source repository and bug tracker, is in I<Makefile.PL> or the I<META.*> files it creates. You can find that on those CPAN web interfaces, but you can also look at files directly in @@ -75,7 +80,7 @@ =back -If you find a problem, file a ticket in the L<issue +If you find a problem, file a ticket in the L<issue tracker|https://github.com/briandfoy/test-output/issues>: =over 4 @@ -94,20 +99,20 @@ L<Stackoverflow|http://www.stackoverflow.com>, both of which have many competent Perlers who can answer your question, almost in real time. They might not know the particulars of this module, but they can help -you diagnose your problem. +you diagnose your problem. -You might like to read L<brian's Guide to Solving Any Perl -Problem|http://archive.oreilly.com/pub/a/perl/excerpts/9780596527242/brians-guide.html>. +You might like to read L<brian's Guide to Solving Any Perl +Problem|https://briandfoy.github.io/brians-guide-to-solving-any-perl-problem/>. =head2 Copyright and License You should have received a I<LICENSE> file, but the license is also noted in the module files. About the only thing you can't do is pretend that -you wrote code that you didn't. +you wrote code that you didn't. =head2 Good luck! -Enjoy, +Enjoy, brian d foy, bd...@cpan.org diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Output-1.031/lib/Test/Output.pm new/Test-Output-1.032/lib/Test/Output.pm --- old/Test-Output-1.031/lib/Test/Output.pm 2017-03-29 23:32:14.000000000 +0200 +++ new/Test-Output-1.032/lib/Test/Output.pm 2021-01-28 23:15:14.000000000 +0100 @@ -1,3 +1,5 @@ +use 5.008; + package Test::Output; use warnings; @@ -5,11 +7,17 @@ use Test::Builder; use Capture::Tiny qw/capture capture_stdout capture_stderr capture_merged/; - -use Exporter qw(import); - -our %EXPORT_TAGS = ( - stdout => [ +use Sub::Exporter -setup => { + exports => [ + qw(output_is output_isnt output_like output_unlike + stderr_is stderr_isnt stderr_like stderr_unlike + stdout_is stdout_isnt stdout_like stdout_unlike + combined_is combined_isnt combined_like combined_unlike + output_from stderr_from stdout_from combined_from + ) + ], + groups => { + stdout => [ qw( stdout_is stdout_isnt stdout_like stdout_unlike ) @@ -42,26 +50,9 @@ combined_is combined_isnt combined_like combined_unlike ) ], - all => [ - qw( - output_is output_isnt output_like output_unlike - stderr_is stderr_isnt stderr_like stderr_unlike - stdout_is stdout_isnt stdout_like stdout_unlike - combined_is combined_isnt combined_like combined_unlike - output_from stderr_from stdout_from combined_from - ) - ], - ); - -our @EXPORT = keys %{ - { - map { $_ => 1 } - map { - @{ $EXPORT_TAGS{$_} } - } - keys %EXPORT_TAGS - } - }; + default => [ '-tests' ], + }, +}; my $Test = Test::Builder->new; @@ -71,9 +62,13 @@ Test::Output - Utilities to test STDOUT and STDERR messages. +=head1 VERSION + +Version 0.16 + =cut -our $VERSION = '1.031'; +our $VERSION = '1.032'; =head1 SYNOPSIS @@ -111,12 +106,16 @@ =head1 DESCRIPTION -Test::Output provides a simple interface for testing output sent to C<STDOUT> -or C<STDERR>. A number of different utilities are included to try and be as +Test::Output provides a simple interface for testing output sent to STDOUT +or STDERR. A number of different utilities are included to try and be as flexible as possible to the tester. -Likewise, L<Capture::Tiny> provides a much more robust capture mechanism without -than the original L<Test::Output::Tie>. +Originally this module was designed not to have external requirements, +however, the features provided by L<Sub::Exporter> over what L<Exporter> +provides is just to great to pass up. + +Likewise, Capture::Tiny provides a much more robust capture mechanism without +than the original Test::Output::Tie. =cut @@ -137,10 +136,10 @@ stdout_isnt( $coderef, $expected, 'description' ); stdout_isnt { ... } $expected, 'description'; -C<stdout_is()> captures output sent to C<STDOUT> from C<$coderef> and compares -it against C<$expected>. The test passes if equal. +stdout_is() captures output sent to STDOUT from $coderef and compares +it against $expected. The test passes if equal. -C<stdout_isnt()> passes if C<STDOUT> is not equal to C<$expected>. +stdout_isnt() passes if STDOUT is not equal to $expected. =cut @@ -185,10 +184,10 @@ stdout_unlike( $coderef, qr/$expected/, 'description' ); stdout_unlike { ... } qr/$expected/, 'description'; -C<stdout_like()> captures the output sent to C<STDOUT> from C<$coderef> and compares -it to the regex in C<$expected>. The test passes if the regex matches. +stdout_like() captures the output sent to STDOUT from $coderef and compares +it to the regex in $expected. The test passes if the regex matches. -C<stdout_unlike()> passes if STDOUT does not match the regex. +stdout_unlike() passes if STDOUT does not match the regex. =back @@ -248,10 +247,10 @@ stderr_isnt( $coderef, $expected, 'description' ); stderr_isnt {... } $expected, 'description'; -C<stderr_is()> is similar to C<stdout_is>, except that it captures C<STDERR>. The -test passes if C<STDERR> from C<$coderef> equals C<$expected>. +stderr_is() is similar to stdout_is, except that it captures STDERR. The +test passes if STDERR from $coderef equals $expected. -C<stderr_isnt()> passes if C<STDERR> is not equal to C<$expected>. +stderr_isnt() passes if STDERR is not equal to $expected. =cut @@ -296,11 +295,11 @@ stderr_unlike( $coderef, qr/$expected/, 'description' ); stderr_unlike { ...} qr/$expected/, 'description'; -C<stderr_like()> is similar to C<stdout_like()> except that it compares the regex -C<$expected> to C<STDERR> captured from C<$codref>. The test passes if the regex +stderr_like() is similar to stdout_like() except that it compares the regex +$expected to STDERR captured from $codref. The test passes if the regex matches. -C<stderr_unlike()> passes if C<STDERR> does not match the regex. +stderr_unlike() passes if STDERR does not match the regex. =back @@ -359,12 +358,12 @@ combined_isnt ( $coderef, $expected, 'description' ); combined_isnt {... } $expected, 'description'; -C<combined_is()> directs C<STDERR> to C<STDOUT> then captures C<STDOUT>. This is -equivalent to UNIXs C<< 2>&1 >>. The test passes if the combined C<STDOUT> -and C<STDERR> from $coderef equals $expected. +combined_is() directs STDERR to STDOUT then captures STDOUT. This is +equivalent to UNIXs 2>&1. The test passes if the combined STDOUT +and STDERR from $coderef equals $expected. -C<combined_isnt()> passes if combined C<STDOUT> and C<STDERR> are not equal -to C<$expected>. +combined_isnt() passes if combined STDOUT and STDERR are not equal +to $expected. =cut @@ -411,11 +410,11 @@ combined_unlike ( $coderef, qr/$expected/, 'description' ); combined_unlike { ...} qr/$expected/, 'description'; -C<combined_like()> is similar to C<combined_is()> except that it compares a regex -(C<$expected)> to C<STDOUT> and C<STDERR> captured from C<$codref>. The test passes if +combined_like() is similar to combined_is() except that it compares a regex +($expected) to STDOUT and STDERR captured from $codref. The test passes if the regex matches. -C<combined_unlike()> passes if the combined C<STDOUT> and C<STDERR> does not match +combined_unlike() passes if the combined STDOUT and STDERR does not match the regex. =back @@ -477,7 +476,7 @@ output_isnt( $coderef, $expected_stdout, $expected_stderr, 'description' ); output_isnt {... } $expected_stdout, $expected_stderr, 'description'; -The C<output_is()> function is a combination of the C<stdout_is()> and C<stderr_is()> +The output_is() function is a combination of the stdout_is() and stderr_is() functions. For example: output_is(sub {print "foo"; print STDERR "bar";},'foo','bar'); @@ -485,14 +484,14 @@ is functionally equivalent to stdout_is(sub {print "foo";},'foo') - && stderr_is(sub {print STDERR "bar";'bar'); + && stderr_is(sub {print STDERR "bar";},'bar'); -except that C<$coderef> is only executed once. +except that $coderef is only executed once. -Unlike C<stdout_is()> and C<stderr_is()> which ignore STDERR and STDOUT -respectively, C<output_is()> requires both C<STDOUT> and C<STDERR> to match in order -to pass. Setting either C<$expected_stdout> or C<$expected_stderr> to C<undef> -ignores C<STDOUT> or C<STDERR> respectively. +Unlike, stdout_is() and stderr_is() which ignore STDERR and STDOUT +respectively, output_is() requires both STDOUT and STDERR to match in order +to pass. Setting either $expected_stdout or $expected_stderr to C<undef> +ignores STDOUT or STDERR respectively. output_is(sub {print "foo"; print STDERR "bar";},'foo',undef); @@ -500,17 +499,17 @@ stdout_is(sub {print "foo";},'foo') -C<output_isnt()> provides the opposite function of C<output_is()>. It is a -combination of C<stdout_isnt()> and C<stderr_isnt()>. +output_isnt() provides the opposite function of output_is(). It is a +combination of stdout_isnt() and stderr_isnt(). output_isnt(sub {print "foo"; print STDERR "bar";},'bar','foo'); is functionally equivalent to - stdout_is(sub {print "foo";},'bar') - && stderr_is(sub {print STDERR "bar";'foo'); + stdout_isnt(sub {print "foo";},'bar') + && stderr_isnt(sub {print STDERR "bar";},'foo'); -As with C<output_is()>, setting either C<$expected_stdout> or C<$expected_stderr> to +As with output_is(), setting either $expected_stdout or $expected_stderr to C<undef> ignores the output to that facility. output_isnt(sub {print "foo"; print STDERR "bar";},undef,'foo'); @@ -626,17 +625,17 @@ output_unlike( $coderef, $regex_stdout, $regex_stderr, 'description' ); output_unlike { ... } $regex_stdout, $regex_stderr, 'description'; -C<output_like()> and C<output_unlike()> follow the same principles as C<output_is()> -and C<output_isnt()> except they use a regular expression for matching. +output_like() and output_unlike() follow the same principles as output_is() +and output_isnt() except they use a regular expression for matching. -C<output_like()> attempts to match C<$regex_stdout> and C<$regex_stderr> against -C<STDOUT> and C<STDERR> produced by $coderef. The test passes if both match. +output_like() attempts to match $regex_stdout and $regex_stderr against +STDOUT and STDERR produced by $coderef. The test passes if both match. output_like(sub {print "foo"; print STDERR "bar";},qr/foo/,qr/bar/); The above test is successful. -Like C<output_is()>, setting either C<$regex_stdout> or C<$regex_stderr> to +Like output_is(), setting either $regex_stdout or $regex_stderr to C<undef> ignores the output to that facility. output_like(sub {print "foo"; print STDERR "bar";},qr/foo/,undef); @@ -645,8 +644,8 @@ stdout_like(sub {print "foo"; print STDERR "bar";},qr/foo/); -C<output_unlike()> test pass if output from C<$coderef> doesn't match -C<$regex_stdout> and C<$regex_stderr>. +output_unlike() test pass if output from $coderef doesn't match +$regex_stdout and $regex_stderr. =back @@ -759,26 +758,56 @@ =head1 EXPORTS -By default, all subroutines are exported by default. +By default, all tests are exported, however with the switch to L<Sub::Exporter> +export groups are now available to better limit imports. + +To import tests for STDOUT: + + use Test::Output qw(:stdout); + +To import tests STDERR: + + use Test::Output qw(:stderr); + +To import just the functions: + + use Test::Output qw(:functions); + +And to import all tests: + + use Test::Output; + +The following is a list of group names and which functions are exported: =over 4 -=item * :stdout - the subs with C<stdout> in the name. +=item stdout + +stdout_is stdout_isnt stdout_like stdout_unlike + +=item stderr + +stderr_is stderr_isnt stderr_like stderr_unlike -=item * :stderr - the subs with C<stderr> in the name. +=item output -=item * :functions - the subs with C<_from> at the end. +output_is output_isnt output_like output_unlike -=item * :output - the subs with C<output> in the name. +=item combined -=item * :combined - the subs with C<combined> in the name. +combined_is combined_isnt combined_like combined_unlike -=item * :tests - everything that outputs TAP +=item tests -=item * :all - everything (which is the same as the default) +All of the above, this is the default when no options are given. =back +L<Sub::Exporter> allows for many other options, I encourage reading its +documentation. + +=cut + =head1 FUNCTIONS =cut @@ -808,7 +837,7 @@ my $stderr = stderr_from($coderef) my $stderr = stderr_from { ... }; -C<stderr_from()> executes C<$coderef> and captures C<STDERR>. +stderr_from() executes $coderef and captures STDERR. =cut @@ -832,7 +861,7 @@ my ($stdout, $stderr) = output_from($coderef) my ($stdout, $stderr) = output_from {...}; -C<output_from()> executes C<$coderef> one time capturing both C<STDOUT> and C<STDERR>. +output_from() executes $coderef one time capturing both STDOUT and STDERR. =cut @@ -853,8 +882,8 @@ my $combined = combined_from($coderef); my $combined = combined_from {...}; -C<combined_from()> executes C<$coderef> one time combines C<STDOUT> and C<STDERR>, and -captures them. C<combined_from()> is equivalent to using C<< 2>&1 >> in UNIX. +combined_from() executes $coderef one time combines STDOUT and STDERR, and +captures them. combined_from() is equivalent to using 2>&1 in UNIX. =cut @@ -899,7 +928,7 @@ This module is in Github: - http://github.com/briandfoy/test-output/tree/master + http://github.com/briandfoy/test-output =head1 BUGS @@ -913,19 +942,17 @@ Thanks to chromatic whose TieOut.pm was the basis for capturing output. Also thanks to rjbs for his help cleaning the documentation, and pushing me to -L<Sub::Exporter>. (This feature has been removed since it uses none of -L<Sub::Exporter>'s strengths). +L<Sub::Exporter>. Thanks to David Wheeler for providing code block support and tests. -Thanks to Michael G Schwern for the solution to combining C<STDOUT> and C<STDERR>. +Thanks to Michael G Schwern for the solution to combining STDOUT and STDERR. =head1 COPYRIGHT & LICENSE -Copyright 2005-2013 Shawn Sorichetti, All Rights Reserved. +Copyright 2005-2021 Shawn Sorichetti, All Rights Reserved. -This program is free software; you can redistribute it and/or modify it -under the same terms as Perl itself. +This module is licensed under the Artistic License 2.0. =cut