- save_output('stderr', *STDERR{IO});
- ok (evcheck(sub { $p = Term::ProgressBar->new(10); }, 'Count 1-20 (1)' ),
- 1, 'Count 1-20 (1)');
- ok (evcheck(sub { $p->update($_) for 1..5 }, 'Count 1-20 (2)' ),
- 1, 'Count 1-20 (2)');
- ok (evcheck(sub { $p->target(20) }, 'Count 1-20 (3)' ),
- 1, 'Count 1-20 (3)');
- ok (evcheck(sub { $p->update($_) for 11..20 }, 'Count 1-20 (4)' ),
- 1, 'Count 1-20 (4)');
- my $err = restore_output('stderr');
-
- $err =~ s!^.*\r!!gm;
- print STDERR "ERR:\n$err\nlength: ", length($err), "\n"
+ lives_ok { $p = Term::ProgressBar->new(10); } 'Count 1-20 (1)';
+ lives_ok { $p->update($_) for 1..5 } 'Count 1-20 (2)';
+ lives_ok { $p->target(20) } 'Count 1-20 (3)';
+ lives_ok { $p->update($_) for 11..20 } 'Count 1-20 (4)';
+};
+
+$err =~ s!^.*\r!!gm;
+diag "ERR:\n$err\nlength: " . length($err)