Hello community,
here is the log from the commit of package perl-Term-ProgressBar for
openSUSE:Factory checked in at 2015-04-15 16:23:02
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-Term-ProgressBar (Old)
and /work/SRC/openSUSE:Factory/.perl-Term-ProgressBar.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Term-ProgressBar"
Changes:
--------
---
/work/SRC/openSUSE:Factory/perl-Term-ProgressBar/perl-Term-ProgressBar.changes
2014-06-30 21:50:28.000000000 +0200
+++
/work/SRC/openSUSE:Factory/.perl-Term-ProgressBar.new/perl-Term-ProgressBar.changes
2015-04-15 16:23:03.000000000 +0200
@@ -1,0 +2,15 @@
+Mon Apr 13 19:08:26 UTC 2015 - [email protected]
+
+- updated to 2.17
+ see /usr/share/doc/packages/perl-Term-ProgressBar/Changes
+
+ 2.17 2015-01-23
+ - Handle case when the maximum number of items is unknown (LukeGoodsell)
+
+ 2.16 2014-09-09 17:00:00
+ - Cygwin width issue RT #8344 (LukeGoodsell)
+ - Remove unused DEBUG variables.
+ - Stop exorting $PACKAGE $VERSION.
+ - Add use warnings;
+
+-------------------------------------------------------------------
Old:
----
Term-ProgressBar-2.15.tar.gz
New:
----
Term-ProgressBar-2.17.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ perl-Term-ProgressBar.spec ++++++
--- /var/tmp/diff_new_pack.M7HQHK/_old 2015-04-15 16:23:03.000000000 +0200
+++ /var/tmp/diff_new_pack.M7HQHK/_new 2015-04-15 16:23:03.000000000 +0200
@@ -1,7 +1,7 @@
#
# spec file for package perl-Term-ProgressBar
#
-# Copyright (c) 2014 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
@@ -16,57 +16,72 @@
#
-%define modname Term-ProgressBar
-
-Name: perl-%{modname}
-Version: 2.15
+Name: perl-Term-ProgressBar
+Version: 2.17
Release: 0
-Summary: A progress bar for terminals
-License: GPL-1.0+ or Artistic-1.0
+%define cpan_name Term-ProgressBar
+Summary: provide a progress meter on a standard terminal
+License: Artistic-1.0 or GPL-1.0+
Group: Development/Libraries/Perl
-Requires: perl(Class::MethodMaker)
-Requires: perl(Term::ReadKey)
-BuildRequires: perl(Capture::Tiny) >= 0.13
-BuildRequires: perl(Class::MethodMaker)
-BuildRequires: perl(Term::ReadKey)
-BuildRequires: perl(Test::Exception)
-Source:
http://search.cpan.org/CPAN/authors/id/S/SZ/SZABGAB/%{modname}-%{version}.tar.gz
Url: http://search.cpan.org/dist/Term-ProgressBar/
+Source:
http://www.cpan.org/authors/id/S/SZ/SZABGAB/%{cpan_name}-%{version}.tar.gz
+BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
+BuildRequires: perl
+BuildRequires: perl-macros
+BuildRequires: perl(Capture::Tiny) >= 0.13
+BuildRequires: perl(Class::MethodMaker) >= 1.02
+BuildRequires: perl(Term::ReadKey) >= 2.14
+BuildRequires: perl(Test::Exception) >= 0.31
+BuildRequires: perl(Test::More) >= 0.80
+Requires: perl(Class::MethodMaker) >= 1.02
+Requires: perl(Term::ReadKey) >= 2.14
+%{perl_requires}
%description
-This module provides a simple progress indicator for command line
-programs. You initialize a ProgressBar object with a brief
-description of what is happening and the number of things that need
-doing, and after each thing is done you call the object's update()
-method.
-
-At the moment, this is presented to the user (on stderr) as a sequence
-of 50 hash marks (no matter how many things are being done).
+Term::ProgressBar provides a simple progress bar on the terminal, to let
+the user know that something is happening, roughly how much stuff has been
+done, and maybe an estimate at how long remains.
+
+A typical use sets up the progress bar with a number of items to do, and
+then calls "update" to update the bar whenever an item is processed.
+
+Often, this would involve updating the progress bar many times with no
+user-visible change. To avoid unnecessary work, the update method returns a
+value, being the update value at which the user will next see a change. By
+only calling update when the current value exceeds the next update value,
+the call overhead is reduced.
+
+Remember to call the '$progress->update($max_value)' when the job is done
+to get a nice 100% done bar.
+
+A progress bar by default is simple; it just goes from left-to-right,
+filling the bar with '=' characters. These are called *major* characters.
+For long-running jobs, this may be too slow, so two additional features are
+available: a linear completion time estimator, and/or a *minor* character:
+this is a character that _moves_ from left-to-right on the progress bar (it
+does not fill it as the major character does), traversing once for each
+major-character added. This exponentially increases the granularity of the
+bar for the same width.
%prep
-%setup -q -n %{modname}-%{version}
-%__sed -i 's/\r$//' examples/*.pl
+%setup -q -n %{cpan_name}-%{version}
+find . -type f -print0 | xargs -0 chmod 644
%build
-perl Makefile.PL OPTIMIZE="$RPM_OPT_FLAGS -Wall"
-make
+%{__perl} Makefile.PL INSTALLDIRS=vendor
+%{__make} %{?_smp_mflags}
%check
-make test
+%{__make} test
%install
-rm -rf %{buildroot}
-make DESTDIR=$RPM_BUILD_ROOT install_vendor
+%perl_make_install
%perl_process_packlist
+%perl_gen_filelist
-%clean
-rm -rf %{buildroot}
-
-%files
-%defattr(-, root, root)
-%doc README Changes examples
-%doc %{_mandir}/man?/*
-%{perl_vendorlib}/Term
+%files -f %{name}.files
+%defattr(-,root,root,755)
+%doc Changes examples README
%changelog
++++++ Term-ProgressBar-2.15.tar.gz -> Term-ProgressBar-2.17.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Term-ProgressBar-2.15/Changes
new/Term-ProgressBar-2.17/Changes
--- old/Term-ProgressBar-2.15/Changes 2014-04-13 22:37:09.000000000 +0200
+++ new/Term-ProgressBar-2.17/Changes 2015-01-23 04:23:08.000000000 +0100
@@ -1,5 +1,14 @@
Revision history for Perl extension Term-ProgressBar
+2.17 2015-01-23
+ - Handle case when the maximum number of items is unknown (LukeGoodsell)
+
+2.16 2014-09-09 17:00:00
+ - Cygwin width issue RT #8344 (LukeGoodsell)
+ - Remove unused DEBUG variables.
+ - Stop exorting $PACKAGE $VERSION.
+ - Add use warnings;
+
2.15 2014-04-13 23:23:23
- Add Term::ProgressBar::IO (DON)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Term-ProgressBar-2.15/MANIFEST
new/Term-ProgressBar-2.17/MANIFEST
--- old/Term-ProgressBar-2.15/MANIFEST 2014-04-13 22:42:59.000000000 +0200
+++ new/Term-ProgressBar-2.17/MANIFEST 2015-01-23 04:25:02.000000000 +0100
@@ -6,6 +6,7 @@
examples/powers5
examples/simple_use.pl
examples/smooth_bar.pl
+examples/stdinorfile.pl
lib/Term/ProgressBar.pm
lib/Term/ProgressBar/IO.pm
Makefile.PL
@@ -16,6 +17,7 @@
t/02_term_progressbar_io.t
t/compat.t
t/eta-linear.t
+t/lessthanzero.t
t/name.t
t/random_file
t/silent.t
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Term-ProgressBar-2.15/MANIFEST.SKIP
new/Term-ProgressBar-2.17/MANIFEST.SKIP
--- old/Term-ProgressBar-2.15/MANIFEST.SKIP 2012-05-16 10:59:20.000000000
+0200
+++ new/Term-ProgressBar-2.17/MANIFEST.SKIP 2014-09-09 16:10:01.000000000
+0200
@@ -13,3 +13,5 @@
^INFO.yaml$
^_build/
^MYMETA.*
+cover_db/
+.travis.yml
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Term-ProgressBar-2.15/META.json
new/Term-ProgressBar-2.17/META.json
--- old/Term-ProgressBar-2.15/META.json 2014-04-13 22:42:58.000000000 +0200
+++ new/Term-ProgressBar-2.17/META.json 2015-01-23 04:25:02.000000000 +0100
@@ -4,7 +4,7 @@
"Martyn J. Pearce"
],
"dynamic_config" : 1,
- "generated_by" : "ExtUtils::MakeMaker version 6.82, CPAN::Meta::Converter
version 2.132830",
+ "generated_by" : "ExtUtils::MakeMaker version 6.98, CPAN::Meta::Converter
version 2.142060",
"license" : [
"perl_5"
],
@@ -49,5 +49,5 @@
"url" : "https://github.com/szabgab/Term-ProgressBar"
}
},
- "version" : "2.15"
+ "version" : "2.17"
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Term-ProgressBar-2.15/META.yml
new/Term-ProgressBar-2.17/META.yml
--- old/Term-ProgressBar-2.15/META.yml 2014-04-13 22:42:58.000000000 +0200
+++ new/Term-ProgressBar-2.17/META.yml 2015-01-23 04:25:02.000000000 +0100
@@ -3,29 +3,29 @@
author:
- 'Martyn J. Pearce'
build_requires:
- Capture::Tiny: 0.13
- File::Temp: 0
- Test::Exception: 0.31
- Test::More: 0.80
+ Capture::Tiny: '0.13'
+ File::Temp: '0'
+ Test::Exception: '0.31'
+ Test::More: '0.80'
configure_requires:
- ExtUtils::MakeMaker: 0
+ ExtUtils::MakeMaker: '0'
dynamic_config: 1
-generated_by: 'ExtUtils::MakeMaker version 6.82, CPAN::Meta::Converter version
2.132830'
+generated_by: 'ExtUtils::MakeMaker version 6.98, CPAN::Meta::Converter version
2.142060'
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
- version: 1.4
+ version: '1.4'
name: Term-ProgressBar
no_index:
directory:
- t
- inc
requires:
- Carp: 0
- Class::MethodMaker: 1.02
- Fatal: 0
- POSIX: 0
- Term::ReadKey: 2.14
+ Carp: '0'
+ Class::MethodMaker: '1.02'
+ Fatal: '0'
+ POSIX: '0'
+ Term::ReadKey: '2.14'
resources:
repository: https://github.com/szabgab/Term-ProgressBar
-version: 2.15
+version: '2.17'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Term-ProgressBar-2.15/examples/stdinorfile.pl
new/Term-ProgressBar-2.17/examples/stdinorfile.pl
--- old/Term-ProgressBar-2.15/examples/stdinorfile.pl 1970-01-01
01:00:00.000000000 +0100
+++ new/Term-ProgressBar-2.17/examples/stdinorfile.pl 2015-01-23
04:20:31.000000000 +0100
@@ -0,0 +1,43 @@
+#!/usr/bin/perl
+use strict;
+use warnings;
+
+use Term::ProgressBar 2.00;
+
+my $input_file = shift;
+my $output_file = shift;
+my $in_fh = \*STDIN;
+my $out_fh = \*STDOUT;
+my $message_fh = \*STDERR;
+my $num_lines = -1;
+
+if(defined($input_file) and $input_file ne '-') {
+ open($in_fh, $input_file) or die "Couldn't open file, '$input_file',
for reading: $!";
+ my $wc_output = `wc -l $input_file`;
+ chomp($wc_output);
+ $wc_output =~ /^\s*(\d+)(\D.*)?/ or die "Couldn't parse wc output:
$wc_output";
+ $num_lines = $1;
+}
+
+if(defined($output_file)) {
+ !-f $output_file or die "Specified output file, '$output_file', already
exists";
+ open($out_fh, '>', $output_file) or die "Couldn't open output file,
'$output_file', for writing: $!";
+}
+
+my $progress = Term::ProgressBar->new({
+ name => 'file processor',
+ count => $num_lines,
+ remove => 1,
+ fh => $message_fh,
+});
+
+while(my $line = <$in_fh>) {
+ chomp($line);
+ print $out_fh "I found a line: $line\n";
+ $progress->message("Found 10000!") if($line =~ /10000/);
+ $progress->update();
+}
+
+$progress->update($num_lines);
+
+print $message_fh "Finished\n";
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Term-ProgressBar-2.15/lib/Term/ProgressBar/IO.pm
new/Term-ProgressBar-2.17/lib/Term/ProgressBar/IO.pm
--- old/Term-ProgressBar-2.15/lib/Term/ProgressBar/IO.pm 2014-04-13
22:37:54.000000000 +0200
+++ new/Term-ProgressBar-2.17/lib/Term/ProgressBar/IO.pm 2015-01-23
04:23:54.000000000 +0100
@@ -1,9 +1,13 @@
+package Term::ProgressBar::IO;
+use strict;
+use warnings;
+
+our $VERSION = '2.17';
+
# This program is free software; you can redistribute it and/or
# modify it under the same terms as Perl itself.
# Copyright 2014 by Don Armstrong <[email protected]>.
-package Term::ProgressBar::IO;
-
=head1 NAME
Term::ProgressBar::IO -- Display a progress bar while reading from a seekable
filehandle
@@ -31,19 +35,10 @@
=cut
-use warnings;
-use strict;
-use vars qw($VERSION $DEBUG);
-
use parent qw(Term::ProgressBar);
use Carp;
use Fcntl qw(:seek);
-BEGIN{
- $VERSION = q(2.15);
- $DEBUG = 0 unless defined $DEBUG;
-}
-
=head1 METHODS
=head2 new
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Term-ProgressBar-2.15/lib/Term/ProgressBar.pm
new/Term-ProgressBar-2.17/lib/Term/ProgressBar.pm
--- old/Term-ProgressBar-2.15/lib/Term/ProgressBar.pm 2014-04-13
22:40:16.000000000 +0200
+++ new/Term-ProgressBar-2.17/lib/Term/ProgressBar.pm 2015-01-23
04:23:24.000000000 +0100
@@ -1,4 +1,8 @@
package Term::ProgressBar;
+use strict;
+use warnings;
+
+our $VERSION = '2.17';
#XXX TODO Redo original test with count=20
# Amount Output
@@ -143,6 +147,67 @@
The complete text of this example is in F<examples/powers3> in the
distribution set (it is not installed as part of the module.
+=head2 When the maximum number of items is sometimes unknown
+
+Sometimes you may wish to use the progress bar when the number of items may or
+may not be known. One common example is when you write a script that can take
+input piped from the output of another command, and then pipe the output to yet
+another command. eg:
+
+ some_command --arg value | my_script.pl | some_other_command
+
+Or ...
+
+ my_script.pl input_file output_file
+
+This example shows how you can iterate over a file specified on the command
line
+with the progress bar. Since the input file may be read from STDIN, the number
+of lines may not be known. Term::ProgressBar handles this by just taking '-1'
as
+the count value and with no further changes to the code. By calling update
+with the same count value, you ensure the progress bar is removed afterwards.
+
+ my $input_file = shift;
+ my $output_file = shift;
+ my $in_fh = \*STDIN;
+ my $out_fh = \*STDOUT;
+ my $message_fh = \*STDERR;
+ my $num_lines = -1;
+
+ if(defined($input_file) and $input_file ne '-') {
+ open($in_fh, $input_file) or die "Couldn't open file, '$input_file': $!";
+ my $wc_output = `wc -l $input_file`;
+ chomp($wc_output);
+ $wc_output =~ /^\s*(\d+)(\D.*)?/ or die "Couldn't parse wc output:
$wc_output";
+ $num_lines = $1;
+ }
+
+ if(defined($output_file)) {
+ !-f $output_file or die "Specified output file, '$output_file', already
exists";
+ open($out_fh, '>', $output_file) or die "Couldn't open output file,
'$output_file': $!";
+ }
+
+ my $progress = Term::ProgressBar->new({
+ name => 'file processor',
+ count => $num_lines,
+ remove => 1,
+ fh => $message_fh,
+ });
+
+ while(my $line = <$in_fh>) {
+ chomp($line);
+ print $out_fh "I found a line: $line\n";
+ $progress->message("Found 10000!") if($line =~ /10000/);
+ $progress->update();
+ }
+
+ $progress->update($num_lines);
+
+ print $message_fh "Finished\n";
+
+When the file is defined explicitly, the progress bar displays the linewise
+progress through the file. Since the progress bar by default prints output to
+stderr, your scripts output to STDOUT will not be affected.
+
=head2 Using Completion Time Estimation
my $progress = Term::ProgressBar->new({name => 'Powers',
@@ -179,39 +244,11 @@
=cut
-# ----------------------------------------------------------------------
-
-# Pragmas --------------------------
-
-use strict;
-
-# Inheritance ----------------------
-
-use base qw( Exporter );
-use vars '@EXPORT_OK';
-@EXPORT_OK = qw( $PACKAGE $VERSION );
-
-# Utility --------------------------
-
use Carp qw( croak );
use Class::MethodMaker 1.02 qw( );
use Fatal qw( open sysopen close seek );
use POSIX qw( ceil strftime );
-# ----------------------------------------------------------------------
-
-# CLASS METHODS --------------------------------------------------------
-
-# ----------------------------------
-# CLASS CONSTANTS
-# ----------------------------------
-
-=head1 CLASS CONSTANTS
-
-Z<>
-
-=cut
-
use constant MINUTE => 60;
use constant HOUR => 60 * MINUTE;
use constant DAY => 24 * HOUR;
@@ -247,21 +284,6 @@
use constant ALREADY_FINISHED => 'progress bar already finished';
-use constant DEBUG => 0;
-
-# -------------------------------------
-
-use vars qw($PACKAGE $VERSION);
-$PACKAGE = 'Term-ProgressBar';
-$VERSION = '2.15';
-
-# ----------------------------------
-# CLASS CONSTRUCTION
-# ----------------------------------
-
-# ----------------------------------
-# CLASS COMPONENTS
-# ----------------------------------
# This is here to allow testing to redirect away from the terminal but still
# see terminal output, IYSWIM
@@ -298,7 +320,7 @@
my $result;
eval {
$result = (Term::ReadKey::GetTerminalSize($fh))[0];
- $result-- if ($^O eq "MSWin32");
+ $result-- if ($^O eq "MSWin32" or $^O eq "cygwin");
}; if ( $@ ) {
warn "error from Term::ReadKey::GetTerminalSize(): $@";
}
@@ -316,21 +338,10 @@
return $result;
}
-
-# INSTANCE METHODS -----------------------------------------------------
-
-# ----------------------------------
-# INSTANCE CONSTRUCTION
-# ----------------------------------
+# Don't document hash keys until tested that the give the desired affect!
=head1 INSTANCE CONSTRUCTION
-Z<>
-
-=cut
-
-# Don't document hash keys until tested that the give the desired affect!
-
=head2 new
Create & return a new Term::ProgressBar instance.
@@ -350,6 +361,12 @@
The item count. The progress is marked at 100% when update I<count> is
invoked, and proportionally until then.
+If you specify a count less than zero, just the name (if specified) will be
+displayed and (if the remove flag is set) removed when the progress bar is
+updated with a number lower than zero. This allows you to use the progress bar
+when the count is sometimes known and sometimes not without making multiple
+changes throughout your code.
+
=item name
A name to prefix the progress bar with.
@@ -785,12 +802,28 @@
my $name = $self->name;
my $fh = $self->fh;
- if ( $target < 1 ) {
+
+ if ( $target < 0 ) {
+ if($input_so_far <= 0 or $input_so_far == $self->last_update) {
+ print $fh "\r", ' ' x $self->term_width, "\r";
+
+ if(defined $name) {
+ if(!$self->remove or $input_so_far >= 0) {
+ print $fh "$name...";
+ }
+ if(!$self->remove and $input_so_far < 0) {
+ print $fh "\n";
+ }
+ }
+ }
+ $self->last_update($input_so_far);
+ return 2**32-1;
+ } elsif ( $target == 0 ) {
print $fh "\r";
printf $fh "$name: "
if defined $name;
print $fh "(nothing to do)\n";
- return 2**32-1;
+ return 2**32-1;
}
my $biggies = $self->major_units * $so_far;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Term-ProgressBar-2.15/t/lessthanzero.t
new/Term-ProgressBar-2.17/t/lessthanzero.t
--- old/Term-ProgressBar-2.15/t/lessthanzero.t 1970-01-01 01:00:00.000000000
+0100
+++ new/Term-ProgressBar-2.17/t/lessthanzero.t 2015-01-23 04:20:31.000000000
+0100
@@ -0,0 +1,102 @@
+# (X)Emacs mode: -*- cperl -*-
+
+use strict;
+use warnings;
+
+=head1 Unit Test Package for Term::ProgressBar
+
+This package tests the zero-progress handling of progress bar.
+
+=cut
+
+use Test::More tests => 10;
+use Test::Exception;
+
+use Capture::Tiny qw(capture_stderr);
+
+use_ok 'Term::ProgressBar';
+
+Term::ProgressBar->__force_term (50);
+
+# -------------------------------------
+
+=head2 Tests 2--4: V1 mode
+
+Create a progress bar with fewer than -1 things.
+Update it it from 1 to 10.
+
+(1) Check no exception thrown on creation
+(2) Check no exception thrown on update
+(3) Check bar displays name
+
+=cut
+
+{
+ my $p;
+ my $name = 'doing nothing';
+ my $err = capture_stderr {
+ lives_ok { $p = Term::ProgressBar->new($name, -1); } 'V1 mode ( 1)';
+ lives_ok { $p->update($_) for 1..10 } 'V1 mode ( 2)';
+ };
+
+ my @lines = grep { $_ ne ''} split /\r/, $err;
+ diag explain @lines
+ if $ENV{TEST_DEBUG};
+ like $lines[-1], qr/^$name...$/, 'V1 mode (
3)';
+}
+
+# -------------------------------------
+
+=head2 Tests 5--7: V2 mode
+
+Create a progress bar with -1 things.
+Update it it from 1 to 10.
+
+(1) Check no exception thrown on creation
+(2) Check no exception thrown on update
+(3) Check bar displays name
+
+=cut
+
+{
+ my $p;
+ my $name = 'doing nothing';
+ my $err = capture_stderr {
+ lives_ok { $p = Term::ProgressBar->new({ count => -1, name => $name }); }
'V2 mode ( 1)';
+ lives_ok { $p->update($_) for 1..10 } 'V2 mode ( 2)';
+ };
+
+ my @lines = grep {$_ ne ''} split /\r/, $err;
+ diag explain @lines
+ if $ENV{TEST_DEBUG};
+ like $lines[-1], qr/^$name...$/, 'V2 mode ( 3)';
+}
+
+# -------------------------------------
+
+=head2 Tests 8--10: V2 mode
+
+Create a progress bar with -1 things and remove = 1.
+Update it with -1
+
+(1) Check no exception thrown on creation
+(2) Check no exception thrown on update
+(3) Check bar is removed
+
+=cut
+
+{
+ my $p;
+ my $name = 'doing nothing';
+ my $err = capture_stderr {
+ lives_ok { $p = Term::ProgressBar->new({ count => -1, name => $name,
remove => 1 }); } 'V2 mode ( 1)';
+ lives_ok { $p->update(-1) } 'V2 mode ( 2)';
+ };
+
+ my @lines = grep {$_ ne ''} split /\r/, $err;
+ diag explain @lines
+ if $ENV{TEST_DEBUG};
+ like $lines[-1], qr/^\s*$/, 'V2 mode ( 3)';
+}
+
+# ----------------------------------------------------------------------------