Hello community, here is the log from the commit of package perl-IO-Pager for openSUSE:Factory checked in at 2015-04-16 14:14:17 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/perl-IO-Pager (Old) and /work/SRC/openSUSE:Factory/.perl-IO-Pager.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-IO-Pager" Changes: -------- --- /work/SRC/openSUSE:Factory/perl-IO-Pager/perl-IO-Pager.changes 2013-06-06 12:20:47.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.perl-IO-Pager.new/perl-IO-Pager.changes 2015-04-16 14:14:19.000000000 +0200 @@ -1,0 +2,30 @@ +Thu Apr 16 08:01:17 UTC 2015 - [email protected] + +- updated to 0.34 + see /usr/share/doc/packages/perl-IO-Pager/CHANGES + + 0.34 Wed Feb 25 2015 + + Fix version error in Makefile. + + Fix a bug in 3-arg open introduced by fix for 1-arg in 0.33. + + 0.33 Wed Feb 25 2005 + + Fix "Warning: unable to close filehandle $real_fh properly." + + Fixed FILEHANDLE only open(). + + 0.32 Tue Feb 24 2005 + + Add 3-arg open support. + + Add eof() mechanism for semi-elegant signal handling. + + Update documentation. + + Undef $ENV{LESS} in interactive tests in case -E is set. + + Robustify t/11 for Win32 (RT#79950). + +------------------------------------------------------------------- Old: ---- IO-Pager-0.31.tgz New: ---- IO-Pager-0.34.tgz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-IO-Pager.spec ++++++ --- /var/tmp/diff_new_pack.dWNm0I/_old 2015-04-16 14:14:19.000000000 +0200 +++ /var/tmp/diff_new_pack.dWNm0I/_new 2015-04-16 14:14:19.000000000 +0200 @@ -1,7 +1,7 @@ # # spec file for package perl-IO-Pager # -# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,22 +17,19 @@ Name: perl-IO-Pager -Version: 0.31 +Version: 0.34 Release: 0 %define cpan_name IO-Pager Summary: Select a pager and pipe text to it if destination is a TTY License: GPL-1.0+ or Artistic-1.0 Group: Development/Libraries/Perl Url: http://search.cpan.org/dist/IO-Pager/ -Source: http://www.cpan.org/authors/id/J/JP/JPIERCE/%{cpan_name}-%{version}.tgz +Source0: http://www.cpan.org/authors/id/J/JP/JPIERCE/%{cpan_name}-%{version}.tgz BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: perl BuildRequires: perl-macros BuildRequires: perl(File::Which) -#BuildRequires: perl(IO::Pager) -#BuildRequires: perl(IO::Pager::Unbuffered) -#BuildRequires: perl(t::TestUtils) Requires: perl(File::Which) %{perl_requires} ++++++ IO-Pager-0.31.tgz -> IO-Pager-0.34.tgz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/IO-Pager-0.31/.proverc new/IO-Pager-0.34/.proverc --- old/IO-Pager-0.31/.proverc 1970-01-01 01:00:00.000000000 +0100 +++ new/IO-Pager-0.34/.proverc 2015-02-19 16:01:55.000000000 +0100 @@ -0,0 +1 @@ +-b \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/IO-Pager-0.31/CHANGES new/IO-Pager-0.34/CHANGES --- old/IO-Pager-0.31/CHANGES 2013-04-06 17:23:37.000000000 +0200 +++ new/IO-Pager-0.34/CHANGES 2015-02-25 23:48:21.000000000 +0100 @@ -1,5 +1,29 @@ Revision history for Perl extension IO::Pager. +0.34 Wed Feb 25 2015 + + Fix version error in Makefile. + + Fix a bug in 3-arg open introduced by fix for 1-arg in 0.33. + +0.33 Wed Feb 25 2005 + + Fix "Warning: unable to close filehandle $real_fh properly." + + Fixed FILEHANDLE only open(). + +0.32 Tue Feb 24 2005 + + Add 3-arg open support. + + Add eof() mechanism for semi-elegant signal handling. + + Update documentation. + + Undef $ENV{LESS} in interactive tests in case -E is set. + + Robustify t/11 for Win32 (RT#79950). + 0.31 Sat Apr 06 2013 Add missing IO::Handle fallback for ::Unbuffered (RT#82351) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/IO-Pager-0.31/MANIFEST new/IO-Pager-0.34/MANIFEST --- old/IO-Pager-0.31/MANIFEST 2013-04-06 17:25:42.000000000 +0200 +++ new/IO-Pager-0.34/MANIFEST 2015-02-25 23:48:48.000000000 +0100 @@ -7,6 +7,7 @@ lib/IO/Pager/Unbuffered.pm README TODO +.proverc t.pl t/01-load.t t/02-which.t @@ -22,6 +23,8 @@ t/10-close_interactive.t t/11-redirect-oo.pl t/11-redirect-oo.t +t/12-preservelayers_interactive.t +t/13-eof_interactive.t t/TestUtils.pm META.yml Module YAML meta-data (added by MakeMaker) META.json Module JSON meta-data (added by MakeMaker) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/IO-Pager-0.31/META.json new/IO-Pager-0.34/META.json --- old/IO-Pager-0.31/META.json 2013-04-06 17:25:42.000000000 +0200 +++ new/IO-Pager-0.34/META.json 2015-02-25 23:48:47.000000000 +0100 @@ -49,5 +49,5 @@ } }, "release_status" : "stable", - "version" : "0.31" + "version" : "0.34" } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/IO-Pager-0.31/META.yml new/IO-Pager-0.34/META.yml --- old/IO-Pager-0.31/META.yml 2013-04-06 17:25:41.000000000 +0200 +++ new/IO-Pager-0.34/META.yml 2015-02-25 23:48:47.000000000 +0100 @@ -31,4 +31,4 @@ Symbol: 0 Tie::Handle: 0 base: 0 -version: 0.31 +version: 0.34 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/IO-Pager-0.31/TODO new/IO-Pager-0.34/TODO --- old/IO-Pager-0.31/TODO 2012-09-05 01:13:02.000000000 +0200 +++ new/IO-Pager-0.34/TODO 2015-02-25 18:21:56.000000000 +0100 @@ -2,32 +2,23 @@ 0.30 Create a tee sub-class/layer? + recommend PerlIO::Util's :tee in the dox, but provide + a simplified (single file?) pure-perl implementation too, + via a maethod to wrap an existing IO::Pager handle? (0.32) - Complete the ::less subclass so that non-interactive fallback - for OO interaction works. + Might simplify new/open 'procedural' arg-passing mess? (0.33+) + + XXX Complete the ::less subclass to lump all non-interactive + fallback behavior together? (See pagerless branch in git) 0.20 "Fix" multi-pseudo-STDOUT disabled in 09-open.t implementation? Alter tests to cover all invocation schemes, - and document location of each in matrix? + and document location of each in matrix OR use table-driven tests? new/open each class scalar vs. glob vs. OO (non-)fully qualified subclass name - Complicate IO::Pager::new code to make it smartly use first - arg as FH or subclass and remove need for ungainly undef? - - "3-arg open" with layer? - -0.10 - XXX Implement eof? - To indicate SIGPIPE? ...handler localization difficulties (.16) - - Hijack something to return filehandle(?), child (DONE 0.24), etc. - ...but this amounts to nothing more than showing our private parts? - Alas tied FH have no STAT method to pass child as inode (.16) - Accessor for pager too? (.21) - 0.02 Implement IO::Pager::Callback, just because it sounds cool? diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/IO-Pager-0.31/lib/IO/Pager/Buffered.pm new/IO-Pager-0.34/lib/IO/Pager/Buffered.pm --- old/IO-Pager-0.31/lib/IO/Pager/Buffered.pm 2012-09-05 01:13:02.000000000 +0200 +++ new/IO-Pager-0.34/lib/IO/Pager/Buffered.pm 2015-02-25 17:52:18.000000000 +0100 @@ -6,7 +6,7 @@ use SelectSaver; -sub new(;$) { # [FH] +sub new(;$) { # [FH], procedural my($class, $tied_fh); eval { ($class, $tied_fh) = &IO::Pager::_init }; @@ -27,7 +27,7 @@ #Punt to base, preserving FH ($_[0]) for pass by reference to gensym sub open(;$) { # [FH] # IO::Pager::open($_[0], 'IO::Pager::Buffered'); - &new('IO::Pager::Buffered', $_[0]); + &new('IO::Pager::Buffered', $_[0], 'procedural'); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/IO-Pager-0.31/lib/IO/Pager/Page.pm new/IO-Pager-0.34/lib/IO/Pager/Page.pm --- old/IO-Pager-0.31/lib/IO/Pager/Page.pm 2012-09-05 01:13:02.000000000 +0200 +++ new/IO-Pager-0.34/lib/IO/Pager/Page.pm 2015-02-22 16:21:36.000000000 +0100 @@ -1,8 +1,6 @@ package IO::Pager::Page; -use strict; - -our $VERSION = 0.16; +our $VERSION = 0.32; # The meat @@ -18,7 +16,7 @@ # Gravy sub import { my ($self, %opt) = @_; - $SIG{PIPE} = sub{ exit 0; } if $opt{hush}; + $SIG{PIPE} = 'IGNORE' if $opt{hush}; } "Badee badee badee that's all folks!"; @@ -69,7 +67,7 @@ =head1 COPYRIGHT AND LICENSE -Copyright (C) 2003-2012 Jerrad Pierce +Copyright (C) 2003-2015 Jerrad Pierce =over diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/IO-Pager-0.31/lib/IO/Pager/Unbuffered.pm new/IO-Pager-0.34/lib/IO/Pager/Unbuffered.pm --- old/IO-Pager-0.31/lib/IO/Pager/Unbuffered.pm 2013-04-06 16:08:01.000000000 +0200 +++ new/IO-Pager-0.34/lib/IO/Pager/Unbuffered.pm 2015-02-25 03:36:52.000000000 +0100 @@ -16,7 +16,8 @@ return $_[1] if defined($_[2]) && $_[2] eq 'procedural'; #...fall back to IO::Handle for transparent OO programming - eval "require IO::Handle" && return IO::Handle->new_from_fd(fileno($_[1]), 'w'); + eval "require IO::Handle" or die $@; + return IO::Handle->new_from_fd(fileno($_[1]), 'w'); } $!=$@, return 0 if $@ =~ 'pipe'; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/IO-Pager-0.31/lib/IO/Pager.pm new/IO-Pager-0.34/lib/IO/Pager.pm --- old/IO-Pager-0.31/lib/IO/Pager.pm 2013-04-06 16:08:21.000000000 +0200 +++ new/IO-Pager-0.34/lib/IO/Pager.pm 2015-02-25 23:43:01.000000000 +0100 @@ -1,5 +1,5 @@ package IO::Pager; -our $VERSION = 0.31; #Really 0.30 +our $VERSION = 0.34; #Really 0.34 use 5.008; #At least, for decent perlio, and other modernisms use strict; @@ -11,6 +11,7 @@ use overload '+' => "PID", bool=> "PID"; +our $SIGPIPE; sub find_pager { # Return the name (or path) of a pager that IO::Pager can use @@ -76,20 +77,39 @@ #Factory -sub open(;$$) { # [FH], [CLASS] - &new(undef, @_, 'procedural'); +sub open(*;$@) { # FH, [MODE], [CLASS] + my $args = {procedural=>1}; + $args->{mode} = splice(@_, 1, 1) if scalar(@_) == 3; + $args->{subclass} = pop if scalar(@_) == 2; + &new(undef, @_, $args); } #Alternate entrance: drop class but leave FH, subclass -sub new(;$$) { # [FH], [CLASS] +sub new(*;$@) { # FH, [MODE], [CLASS] shift; + my %args; + if( ref($_[-1]) eq 'HASH' ){ + %args = %{pop()}; + warn "REMAINDER? (@_)", scalar @_; + push(@_, $args{procedural}); + } + else{ + $args{mode} = splice(@_, 1, 1) if $_[1] =~ /^:/; + $args{subclass} = pop if exists($_[1]); + } + #Leave filehandle in @_ for pass by reference to allow gensym - my $subclass = $_[1] if exists($_[1]); - $subclass ||= 'IO::Pager::Unbuffered'; - $subclass =~ s/^(?!IO::Pager::)/IO::Pager::/; - eval "require $subclass" or die "Could not load $subclass: $@\n"; - $subclass->new($_[0]); + $args{subclass} ||= 'IO::Pager::Unbuffered'; + $args{subclass} =~ s/^(?!IO::Pager::)/IO::Pager::/; + eval "require $args{subclass}" or die "Could not load $args{subclass}: $@\n"; + my $token = $args{subclass}->new(@_); + + if( defined($args{mode}) ){ + $args{mode} =~ s/^\|-//; + $token->BINMODE($args{mode}); + } + return $token; } @@ -110,8 +130,8 @@ } } - # XXX This allows us to have multiple pseudo-STDOUT -# return 0 unless -t STDOUT; + #XXX This allows us to have multiple pseudo-STDOUT + #return 0 unless -t STDOUT; return ($_[0], $_[1]); } @@ -125,7 +145,7 @@ die "The PAGER environment variable is not defined, you may need to set it manually."; } my($real_fh, $child); - if ( $child = CORE::open($real_fh, "| $PAGER") ){ + if ( $child = CORE::open($real_fh, '|-', $PAGER) ){ my @oLayers = PerlIO::get_layers($tied_fh, details=>1, output=>1); my $layers = ''; for(my $i=0;$i<$#oLayers;$i+=3){ @@ -153,6 +173,22 @@ CORE::binmode($self->{real_fh}, $layer||':raw'); } +sub WNOHANG(); +sub EOF { + my $self = shift; + + unless( defined($SIGPIPE) ){ + eval 'use POSIX ":sys_wait_h";'; + $SIGPIPE = 0; + } + + $SIG{PIPE} = sub { $SIGPIPE = 1 unless $ENV{IP_EOF}; + CORE::close($self->{real_fh}); + waitpid($self->{child}, WNOHANG); + CORE::open($self->{real_fh}, '>&1'); }; + return $SIGPIPE; +} + sub PRINT { my ($self, @args) = @_; @@ -198,7 +234,7 @@ #Provide lowercase aliases for accessors -foreach my $method ( qw(BINMODE CLOSE PRINT PRINTF TELL WRITE PID) ){ +foreach my $method ( qw(BINMODE CLOSE EOF PRINT PRINTF TELL WRITE PID) ){ no strict 'refs'; *{lc($method)} = \&{$method}; } @@ -217,13 +253,38 @@ # Select an appropriate pager and set the PAGER environment variable use IO::Pager; - # Optionally, pipe output to it + # TIMTOWTDI Object-oriented { - # TIMTOWTDI, not an exhaustive list but you can infer the others - my $token = IO::Pager::open *STDOUT; # Unbuffered is default subclass - my $token = new IO::Pager *STDOUT, 'Unbuffered'; # Specify subclass - my $token = IO::Pager::Unbuffered::open *STDOUT; # Must 'use' class! - my $token = new IO::Pager::Unbuffered *STDOUT; # Must 'use' class! + # open() # Use all the defaults. + my $object = new IO::Pager; + + # open FILEHANDLE # Unbuffered is default subclass + my $object = new IO::Pager *STDOUT; + + # open FILEHANDLE,EXPR # Specify subclass + my $object = new IO::Pager *STDOUT, 'Unbuffered'; + + # Direct subclass instantiation # FH is optional + use IO::Pager::Unbuffered; + my $object = new IO::Pager::Unbuffered *STDOUT; + + + $object->print("OO shiny...\n"); + print "Some other text sent to STODUT, perhaps from a foreign routine." + + # $object passes out of scope and filehandle is automagically closed + } + + # TIMTOWTDI Procedural + { + # open FILEHANDLE # Unbuffered is default subclass + my $token = IO::Pager::open *STDOUT; + + # open FILEHANDLE,EXPR # Specify subclass + my $token = IO::Pager::open *STDOUT, 'Unbuffered'; + + # open FILEHANDLE,MODE,EXPR # En lieu of a separate binmode() + my $token = IO::Pager::open *STDOUT, '|-:utf8', 'Unbuffered'; print <<" HEREDOC" ; @@ -236,16 +297,10 @@ { # You can also use scalar filehandles... - my $token = IO::Pager::open($FH) or warn($!); + my $token = IO::Pager::open(my $FH) or warn($!); XXX print $FH "No globs or barewords for us thanks!\n"; } - { - # ...or an object interface - my $token = new IO::Pager::Buffered; - - $token->print("OO shiny...\n"); - } =head1 DESCRIPTION @@ -261,12 +316,12 @@ =head1 METHODS -=head2 new( [FILEHANDLE], [SUBCLASS] ) +=head2 new( FILEHANDLE, [MODE], [SUBCLASS] ) Almost identical to open, except that you will get an L<IO::Handle> -back if there's no TTY to allow for IO::Pager agnostic programming. +back if there's no TTY to allow for IO::Pager-agnostic programming. -=head2 open( [FILEHANDLE], [SUBCLASS] ) +=head2 open( FILEHANDLE, [MODE], [SUBCLASS] ) Instantiate a new IO::Pager, which will paginate output sent to FILEHANDLE if interacting with a TTY. @@ -328,16 +383,37 @@ } #The string "I like trains" is flushed to the pager, and the handle closed -=head2 binmode( FILEHANDLE ) +=head2 binmode( FILEHANDLE, [LAYER] ) Used to set the I/O layer a.k.a. discipline of a filehandle, such as C<':utf8'> for UTF-8 encoding. -=head2 print ( FILEHANDLE LIST ) +=head2 eof( FILEHANDLE ) + +Used in the eval-until-eof idiom below, I<IO::Pager> will handle broken pipes +from deceased children for you in one of two ways. If I<$ENV{IP_EOF}> is +false then program flow will pass out of the loop on I<SIGPIPE>, this is the +default. If the variable is true, then the program continues running with +output for the previously paged filehandle directed to the I<STDOUT> stream; +more accurately, the filehandle is reopened to file descriptor 1. + + use IO::Pager::Page; #or whichever you prefer; + ... + eval{ + say "Producing prodigious portions of product"; + ... + } until( eof(*STDOUT) ); + print "Cleaning up after our child before terminating." + +If using eof() with L<less>, especially when IP_EOF is set, you may want to +use the I<--no-init> option by setting I<$ENV{IP_EOF}='X'> to prevent the +paged output from being erased when the pager exits. + +=head2 print( FILEHANDLE LIST ) print() to the filehandle. -=head2 printf ( FILEHANDLE FORMAT, LIST ) +=head2 printf( FILEHANDLE FORMAT, LIST ) printf() to the filehandle. @@ -349,6 +425,10 @@ =over +=item IP_EOF + +Controls IO:Pager behavior when C<eof> is used. + =item PAGER The location of the default pager. @@ -424,7 +504,7 @@ =head1 COPYRIGHT AND LICENSE -Copyright (C) 2003-2012 Jerrad Pierce +Copyright (C) 2003-2015 Jerrad Pierce =over diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/IO-Pager-0.31/t/05-binmode_interactive.t new/IO-Pager-0.34/t/05-binmode_interactive.t --- old/IO-Pager-0.31/t/05-binmode_interactive.t 2012-09-05 01:13:02.000000000 +0200 +++ new/IO-Pager-0.34/t/05-binmode_interactive.t 2015-02-25 04:39:13.000000000 +0100 @@ -14,11 +14,11 @@ my $warnings; eval { # Promote warnings to errors so we can catch them - $SIG{__WARN__} = sub { $warnings .= shift }; + local $SIG{__WARN__} = sub { $warnings .= shift }; # Stream unicode in a pager - local $STDOUT = new IO::Pager *BOB, 'IO::Pager::Buffered'; - binmode BOB, ":utf8"; + local $STDOUT = new IO::Pager *BOB, ':utf8', 'IO::Pager::Buffered'; + printf BOB "Unicode Z-inverted carat: \x{17D}\n"; #Ž printf BOB "Unicode Copyright < Copyleft: \x{A9} < \x{2184}\x{20DD}\n"; #© < ↄ⃝ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/IO-Pager-0.31/t/09-open.t new/IO-Pager-0.34/t/09-open.t --- old/IO-Pager-0.31/t/09-open.t 2012-09-05 01:13:02.000000000 +0200 +++ new/IO-Pager-0.34/t/09-open.t 2015-02-25 03:51:52.000000000 +0100 @@ -8,7 +8,7 @@ use IO::Pager; SKIP: { - skip("Skiping because Windows has to be different^Wdifficult", 1) + skip("Skipping because Windows has to be different^Wdifficult", 1) if $^O =~ /MSWin32|cygwin/; undef $ENV{PAGER}; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/IO-Pager-0.31/t/11-redirect-oo.t new/IO-Pager-0.34/t/11-redirect-oo.t --- old/IO-Pager-0.31/t/11-redirect-oo.t 2013-04-06 17:25:18.000000000 +0200 +++ new/IO-Pager-0.34/t/11-redirect-oo.t 2015-02-22 00:28:45.000000000 +0100 @@ -14,11 +14,14 @@ open(TMP, $tempname) or die "Could not open tmpfile: $!\n"; my $slurp = do{ undef $/; <TMP> }; -#XXX Perl on Windoze lamely appends an extra newline -#Experimentation with C<use open> layers failed to find a suitable remedy -chop($slurp) if $^O =~ /MSWin32/; +#Special case for CMD lameness, see diag below +if( $^O =~ /MSWin32/ ){ + $slurp =~ s/\r\n$//; +} our $txt; require 't/08-redirect.pl'; -ok($txt eq $slurp, 'Redirection with OO'); +cmp_ok($txt, 'eq', $slurp, 'Redirection with OO') || $^O =~ /MSWin32/ && + diag("If this test fails on Windows and all others pass, things are probably good. CMD appends an extra newline to redirected output."); +; done_testing; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/IO-Pager-0.31/t/12-preservelayers_interactive.t new/IO-Pager-0.34/t/12-preservelayers_interactive.t --- old/IO-Pager-0.31/t/12-preservelayers_interactive.t 1970-01-01 01:00:00.000000000 +0100 +++ new/IO-Pager-0.34/t/12-preservelayers_interactive.t 2012-09-05 05:12:53.000000000 +0200 @@ -0,0 +1,34 @@ +use strict; +use warnings; +use File::Temp; +use Test::More; +use t::TestUtils; + +use 5.6.0; +use utf8; + +use IO::Pager; + +SKIP: { + skip_interactive(); + + my $fileno = fileno(STDOUT); + { + binmode(*STDOUT, ':encoding(UTF-8)'); + my $pager = IO::Pager->new(*STDOUT); + $pager->say('Bonzai Bjørn'); + $pager->say("$/End of text, try pressing 'Q' to exit."); + $pager->close(); + } + + #Reinstate some order + CORE::open(*BOB, ">&=$fileno"); + binmode(*BOB, ':encoding(UTF-8)'); + select(BOB); + + my $A = prompt "\nDid you see 'Bonzai Bjørn' in your pager? Note the crossed o in the second word [Yn]"; + ok is_yes($A), 'layer preservation'; + +} + +done_testing; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/IO-Pager-0.31/t/13-eof_interactive.t new/IO-Pager-0.34/t/13-eof_interactive.t --- old/IO-Pager-0.31/t/13-eof_interactive.t 1970-01-01 01:00:00.000000000 +0100 +++ new/IO-Pager-0.34/t/13-eof_interactive.t 2015-02-25 16:48:52.000000000 +0100 @@ -0,0 +1,26 @@ +use strict; +use warnings; +use File::Temp; +use Test::More; +use t::TestUtils; + +use bignum; +use IO::Pager::Page; + +SKIP: { + skip_interactive(); + + $a=1; $b=1; + eval{ + print $a, "\n"; + + #Fibonacci is the golden ratio + ($a,$b)=($b,$a+$b); + } until( eof(*STDOUT) ); + + print "Pager closed, wrapping up.\n"; + my $A = prompt "\nWere things wrapped up after you quit the pager? [Yn]"; + ok is_yes($A), 'Signal handling EOF'; +} + +done_testing; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/IO-Pager-0.31/t.pl new/IO-Pager-0.34/t.pl --- old/IO-Pager-0.31/t.pl 2012-09-05 01:13:02.000000000 +0200 +++ new/IO-Pager-0.34/t.pl 2015-02-25 16:50:37.000000000 +0100 @@ -1,3 +1,8 @@ +use strict; +use warnings; + +undef($ENV{LESS}); + for (sort glob "t/*interactive.t") { print "Running $_...\n"; system($^X, '-Mblib', $_);
