Hello community,
here is the log from the commit of package perl-Term-Table for openSUSE:Factory
checked in at 2018-12-08 11:20:01
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-Term-Table (Old)
and /work/SRC/openSUSE:Factory/.perl-Term-Table.new.19453 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Term-Table"
Sat Dec 8 11:20:01 2018 rev:4 rq:655832 version:0.013
Changes:
--------
--- /work/SRC/openSUSE:Factory/perl-Term-Table/perl-Term-Table.changes
2017-11-12 17:56:57.296601607 +0100
+++
/work/SRC/openSUSE:Factory/.perl-Term-Table.new.19453/perl-Term-Table.changes
2018-12-08 11:20:12.450848715 +0100
@@ -1,0 +2,8 @@
+Thu Dec 6 16:24:00 UTC 2018 - Stephan Kulow <[email protected]>
+
+- updated to 0.013
+ see /usr/share/doc/packages/perl-Term-Table/Changes
+
+ 0.013 2018-12-04 11:38:36-08:00 America/Los_Angeles
+
+-------------------------------------------------------------------
Old:
----
Term-Table-0.012.tar.gz
New:
----
Term-Table-0.013.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ perl-Term-Table.spec ++++++
--- /var/tmp/diff_new_pack.WqHWrA/_old 2018-12-08 11:20:13.050848141 +0100
+++ /var/tmp/diff_new_pack.WqHWrA/_new 2018-12-08 11:20:13.050848141 +0100
@@ -1,7 +1,7 @@
#
# spec file for package perl-Term-Table
#
-# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2018 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
@@ -12,18 +12,18 @@
# 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/
#
Name: perl-Term-Table
-Version: 0.012
+Version: 0.013
Release: 0
%define cpan_name Term-Table
Summary: Format a header and rows into a table
-License: Artistic-1.0 or GPL-1.0+
+License: Artistic-1.0 OR GPL-1.0-or-later
Group: Development/Libraries/Perl
-Url: http://search.cpan.org/dist/Term-Table/
+Url: https://metacpan.org/release/%{cpan_name}
Source0:
https://cpan.metacpan.org/authors/id/E/EX/EXODIST/%{cpan_name}-%{version}.tar.gz
Source1: cpanspec.yml
BuildArch: noarch
@@ -46,11 +46,11 @@
%setup -q -n %{cpan_name}-%{version}
%build
-%{__perl} Makefile.PL INSTALLDIRS=vendor
-%{__make} %{?_smp_mflags}
+perl Makefile.PL INSTALLDIRS=vendor
+make %{?_smp_mflags}
%check
-%{__make} test
+make test
%install
%perl_make_install
++++++ Term-Table-0.012.tar.gz -> Term-Table-0.013.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Term-Table-0.012/Changes new/Term-Table-0.013/Changes
--- old/Term-Table-0.012/Changes 2017-10-11 17:54:53.000000000 +0200
+++ new/Term-Table-0.013/Changes 2018-12-04 20:38:37.000000000 +0100
@@ -1,3 +1,5 @@
+0.013 2018-12-04 11:38:36-08:00 America/Los_Angeles
+
0.012 2017-10-11 08:54:52-07:00 America/Los_Angeles
- Bump minimum Test2::Tools::Tiny version
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Term-Table-0.012/LICENSE new/Term-Table-0.013/LICENSE
--- old/Term-Table-0.012/LICENSE 2017-10-11 17:54:53.000000000 +0200
+++ new/Term-Table-0.013/LICENSE 2018-12-04 20:38:37.000000000 +0100
@@ -1,4 +1,4 @@
-This software is copyright (c) 2017 by Chad Granum.
+This software is copyright (c) 2018 by Chad Granum.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
@@ -12,7 +12,7 @@
--- The GNU General Public License, Version 1, February 1989 ---
-This software is Copyright (c) 2017 by Chad Granum.
+This software is Copyright (c) 2018 by Chad Granum.
This is free software, licensed under:
@@ -272,7 +272,7 @@
--- The Artistic License 1.0 ---
-This software is Copyright (c) 2017 by Chad Granum.
+This software is Copyright (c) 2018 by Chad Granum.
This is free software, licensed under:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Term-Table-0.012/MANIFEST
new/Term-Table-0.013/MANIFEST
--- old/Term-Table-0.012/MANIFEST 2017-10-11 17:54:53.000000000 +0200
+++ new/Term-Table-0.013/MANIFEST 2018-12-04 20:38:37.000000000 +0100
@@ -1,4 +1,4 @@
-# This file was automatically generated by Dist::Zilla::Plugin::Manifest
v6.009.
+# This file was automatically generated by Dist::Zilla::Plugin::Manifest
v6.010.
Changes
LICENSE
MANIFEST
@@ -23,3 +23,4 @@
t/Table/LineBreak.t
t/bad_blank_line.t
t/honor_env_in_non_tty.t
+t/issue-9.t
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Term-Table-0.012/META.json
new/Term-Table-0.013/META.json
--- old/Term-Table-0.012/META.json 2017-10-11 17:54:53.000000000 +0200
+++ new/Term-Table-0.013/META.json 2018-12-04 20:38:37.000000000 +0100
@@ -4,7 +4,7 @@
"Chad Granum <[email protected]>"
],
"dynamic_config" : 0,
- "generated_by" : "Dist::Zilla version 6.009, CPAN::Meta::Converter version
2.150010",
+ "generated_by" : "Dist::Zilla version 6.010, CPAN::Meta::Converter version
2.150010",
"license" : [
"perl_5"
],
@@ -55,7 +55,7 @@
"url" : "http://github.com/exodist/Term-Table/"
}
},
- "version" : "0.012",
- "x_serialization_backend" : "Cpanel::JSON::XS version 3.0233"
+ "version" : "0.013",
+ "x_serialization_backend" : "Cpanel::JSON::XS version 4.00"
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Term-Table-0.012/META.yml
new/Term-Table-0.013/META.yml
--- old/Term-Table-0.012/META.yml 2017-10-11 17:54:53.000000000 +0200
+++ new/Term-Table-0.013/META.yml 2018-12-04 20:38:37.000000000 +0100
@@ -8,7 +8,7 @@
configure_requires:
ExtUtils::MakeMaker: '0'
dynamic_config: 0
-generated_by: 'Dist::Zilla version 6.009, CPAN::Meta::Converter version
2.150010'
+generated_by: 'Dist::Zilla version 6.010, CPAN::Meta::Converter version
2.150010'
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -27,5 +27,5 @@
resources:
bugtracker: http://github.com/exodist/Term-Table/issues
repository: http://github.com/exodist/Term-Table/
-version: '0.012'
+version: '0.013'
x_serialization_backend: 'YAML::Tiny version 1.70'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Term-Table-0.012/Makefile.PL
new/Term-Table-0.013/Makefile.PL
--- old/Term-Table-0.012/Makefile.PL 2017-10-11 17:54:53.000000000 +0200
+++ new/Term-Table-0.013/Makefile.PL 2018-12-04 20:38:37.000000000 +0100
@@ -1,4 +1,4 @@
-# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker
v6.009.
+# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker
v6.010.
use strict;
use warnings;
@@ -26,7 +26,7 @@
"Test2::Tools::Tiny" => "1.302097",
"utf8" => 0
},
- "VERSION" => "0.012",
+ "VERSION" => "0.013",
"test" => {
"TESTS" => "t/*.t t/Table/*.t"
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Term-Table-0.012/README new/Term-Table-0.013/README
--- old/Term-Table-0.012/README 2017-10-11 17:54:53.000000000 +0200
+++ new/Term-Table-0.013/README 2018-12-04 20:38:37.000000000 +0100
@@ -13,12 +13,15 @@
use Term::Table;
my $table = Term::Table->new(
- max_width => 80, # defaults to terminal size
- collapse => 1, # do not show empty columns
- header => [ 'name', 'age', 'hair color' ],
- rows => [
- [ 'Fred Flinstone', 2000000, 'black' ],
- [ 'Wilma Flinstone', 1999995, 'red' ],
+ max_width => 80, # defaults to terminal size
+ pad => 4, # Extra padding between table and
max-width (defaults to 4)
+ allow_overflow => 0, # default is 0, when off an exception
will be thrown if the table is too big
+ collapse => 1, # do not show empty columns
+
+ header => ['name', 'age', 'hair color'],
+ rows => [
+ ['Fred Flinstone', 2000000, 'black'],
+ ['Wilma Flinstone', 1999995, 'red'],
...
],
);
@@ -64,6 +67,19 @@
find the width of your terminal and use that, otherwise it falls back
to the terminal width or 80.
+ pad => $num
+
+ Defaults to 4, extra padding for row width calculations. Default is
+ for legacy support. Set this to 0 to turn padding off.
+
+ allow_overflow => $bool
+
+ Defaults to 0. If this is off then an exception will be thrown if the
+ table cannot be made to fit inside the max-width. If this is set to 1
+ then the table will be rendered anyway, larger than max-width, if it
+ is not possible to stay within the max-width. In other words this
+ turns max-width from a hard-limit to a soft recommendation.
+
sanitize => $bool
This will sanitize all the data in the table such that newlines,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Term-Table-0.012/README.md
new/Term-Table-0.013/README.md
--- old/Term-Table-0.012/README.md 2017-10-11 17:54:53.000000000 +0200
+++ new/Term-Table-0.013/README.md 2018-12-04 20:38:37.000000000 +0100
@@ -12,12 +12,15 @@
use Term::Table;
my $table = Term::Table->new(
- max_width => 80, # defaults to terminal size
- collapse => 1, # do not show empty columns
- header => [ 'name', 'age', 'hair color' ],
- rows => [
- [ 'Fred Flinstone', 2000000, 'black' ],
- [ 'Wilma Flinstone', 1999995, 'red' ],
+ max_width => 80, # defaults to terminal size
+ pad => 4, # Extra padding between table and max-width
(defaults to 4)
+ allow_overflow => 0, # default is 0, when off an exception will be
thrown if the table is too big
+ collapse => 1, # do not show empty columns
+
+ header => ['name', 'age', 'hair color'],
+ rows => [
+ ['Fred Flinstone', 2000000, 'black'],
+ ['Wilma Flinstone', 1999995, 'red'],
...
],
);
@@ -61,6 +64,19 @@
be no bigger. If none is specified it will attempt to find the width of
your
terminal and use that, otherwise it falls back to the terminal width or
`80`.
+- pad => $num
+
+ Defaults to 4, extra padding for row width calculations. Default is for
legacy
+ support. Set this to 0 to turn padding off.
+
+- allow\_overflow => $bool
+
+ Defaults to 0. If this is off then an exception will be thrown if the table
+ cannot be made to fit inside the max-width. If this is set to 1 then the
table
+ will be rendered anyway, larger than max-width, if it is not possible to
stay
+ within the max-width. In other words this turns max-width from a
hard-limit to
+ a soft recommendation.
+
- sanitize => $bool
This will sanitize all the data in the table such that newlines, control
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Term-Table-0.012/lib/Term/Table/Cell.pm
new/Term-Table-0.013/lib/Term/Table/Cell.pm
--- old/Term-Table-0.012/lib/Term/Table/Cell.pm 2017-10-11 17:54:53.000000000
+0200
+++ new/Term-Table-0.013/lib/Term/Table/Cell.pm 2018-12-04 20:38:37.000000000
+0100
@@ -2,7 +2,7 @@
use strict;
use warnings;
-our $VERSION = '0.012';
+our $VERSION = '0.013';
use Term::Table::LineBreak();
use Term::Table::Util qw/uni_length/;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Term-Table-0.012/lib/Term/Table/CellStack.pm
new/Term-Table-0.013/lib/Term/Table/CellStack.pm
--- old/Term-Table-0.012/lib/Term/Table/CellStack.pm 2017-10-11
17:54:53.000000000 +0200
+++ new/Term-Table-0.013/lib/Term/Table/CellStack.pm 2018-12-04
20:38:37.000000000 +0100
@@ -2,7 +2,7 @@
use strict;
use warnings;
-our $VERSION = '0.012';
+our $VERSION = '0.013';
use Term::Table::HashBase qw/-cells -idx/;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Term-Table-0.012/lib/Term/Table/LineBreak.pm
new/Term-Table-0.013/lib/Term/Table/LineBreak.pm
--- old/Term-Table-0.012/lib/Term/Table/LineBreak.pm 2017-10-11
17:54:53.000000000 +0200
+++ new/Term-Table-0.013/lib/Term/Table/LineBreak.pm 2018-12-04
20:38:37.000000000 +0100
@@ -2,7 +2,7 @@
use strict;
use warnings;
-our $VERSION = '0.012';
+our $VERSION = '0.013';
use Carp qw/croak/;
use Scalar::Util qw/blessed/;
@@ -22,6 +22,7 @@
sub break {
my $self = shift;
my ($len) = @_;
+
$self->{+_LEN} = $len;
$self->{+IDX} = 0;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Term-Table-0.012/lib/Term/Table/Spacer.pm
new/Term-Table-0.013/lib/Term/Table/Spacer.pm
--- old/Term-Table-0.012/lib/Term/Table/Spacer.pm 2017-10-11
17:54:53.000000000 +0200
+++ new/Term-Table-0.013/lib/Term/Table/Spacer.pm 2018-12-04
20:38:37.000000000 +0100
@@ -2,7 +2,7 @@
use strict;
use warnings;
-our $VERSION = '0.012';
+our $VERSION = '0.013';
sub new { bless {}, $_[0] }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Term-Table-0.012/lib/Term/Table/Util.pm
new/Term-Table-0.013/lib/Term/Table/Util.pm
--- old/Term-Table-0.012/lib/Term/Table/Util.pm 2017-10-11 17:54:53.000000000
+0200
+++ new/Term-Table-0.013/lib/Term/Table/Util.pm 2018-12-04 20:38:37.000000000
+0100
@@ -4,7 +4,7 @@
use Config qw/%Config/;
-our $VERSION = '0.012';
+our $VERSION = '0.013';
use Importer Importer => 'import';
our @EXPORT_OK = qw/term_size USE_GCS USE_TERM_READKEY USE_TERM_SIZE_ANY
uni_length/;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Term-Table-0.012/lib/Term/Table.pm
new/Term-Table-0.013/lib/Term/Table.pm
--- old/Term-Table-0.012/lib/Term/Table.pm 2017-10-11 17:54:53.000000000
+0200
+++ new/Term-Table-0.013/lib/Term/Table.pm 2018-12-04 20:38:37.000000000
+0100
@@ -2,7 +2,7 @@
use strict;
use warnings;
-our $VERSION = '0.012';
+our $VERSION = '0.013';
use Term::Table::Cell();
@@ -11,11 +11,10 @@
use List::Util qw/max sum/;
use Carp qw/croak carp/;
-use Term::Table::HashBase qw/rows _columns collapse max_width mark_tail
sanitize show_header auto_columns no_collapse header/;
+use Term::Table::HashBase qw/rows _columns collapse max_width mark_tail
sanitize show_header auto_columns no_collapse header allow_overflow pad/;
sub BORDER_SIZE() { 4 } # '| ' and ' |' borders
sub DIV_SIZE() { 3 } # ' | ' column delimiter
-sub PAD_SIZE() { 4 } # Extra arbitrary padding
sub CELL_PAD_SIZE() { 2 } # space on either side of the |
sub init {
@@ -37,6 +36,8 @@
}
}
+ $self->{+PAD} = 4 unless defined $self->{+PAD};
+
$self->{+COLLAPSE} = 1 unless defined $self->{+COLLAPSE};
$self->{+SANITIZE} = 1 unless defined $self->{+SANITIZE};
$self->{+MARK_TAIL} = 1 unless defined $self->{+MARK_TAIL};
@@ -98,11 +99,16 @@
if $self->{+COLLAPSE};
my $current = sum(map {$_->{width}} @$cols);
- my $border = sum(BORDER_SIZE, PAD_SIZE, DIV_SIZE * @$cols);
+ my $border = sum(BORDER_SIZE, $self->{+PAD}, DIV_SIZE * (@$cols - 1));
my $total = $current + $border;
if ($total > $self->{+MAX_WIDTH}) {
my $fair = ($self->{+MAX_WIDTH} - $border) / @$cols;
+ if ($fair < 1) {
+ return $self->{+_COLUMNS} = $cols if $self->{+ALLOW_OVERFLOW};
+ croak "Table is too large ($total including $self->{+PAD} padding)
to fit into max-width ($self->{+MAX_WIDTH})";
+ }
+
my $under = 0;
my @fix;
for my $c (@$cols) {
@@ -116,6 +122,10 @@
# Recalculate fairness
$fair = int(($self->{+MAX_WIDTH} - $border - $under) / @fix);
+ if ($fair < 1) {
+ return $self->{+_COLUMNS} = $cols if $self->{+ALLOW_OVERFLOW};
+ croak "Table is too large ($total including $self->{+PAD} padding)
to fit into max-width ($self->{+MAX_WIDTH})";
+ }
# Adjust over-long columns
$_->{width} = $fair for @fix;
@@ -133,7 +143,7 @@
$cell->reset;
}
}
- my $width = sum(BORDER_SIZE, PAD_SIZE, DIV_SIZE * @$cols, map {
$_->{width} } @$cols);
+ my $width = sum(BORDER_SIZE, $self->{+PAD}, DIV_SIZE * @$cols, map {
$_->{width} } @$cols);
#<<< NO-TIDY
my $border = '+' . join('+', map { '-' x ($_->{width} + CELL_PAD_SIZE)
} @$cols) . '+';
@@ -259,12 +269,15 @@
use Term::Table;
my $table = Term::Table->new(
- max_width => 80, # defaults to terminal size
- collapse => 1, # do not show empty columns
- header => [ 'name', 'age', 'hair color' ],
- rows => [
- [ 'Fred Flinstone', 2000000, 'black' ],
- [ 'Wilma Flinstone', 1999995, 'red' ],
+ max_width => 80, # defaults to terminal size
+ pad => 4, # Extra padding between table and max-width
(defaults to 4)
+ allow_overflow => 0, # default is 0, when off an exception will be
thrown if the table is too big
+ collapse => 1, # do not show empty columns
+
+ header => ['name', 'age', 'hair color'],
+ rows => [
+ ['Fred Flinstone', 2000000, 'black'],
+ ['Wilma Flinstone', 1999995, 'red'],
...
],
);
@@ -310,6 +323,19 @@
be no bigger. If none is specified it will attempt to find the width of your
terminal and use that, otherwise it falls back to the terminal width or C<80>.
+=item pad => $num
+
+Defaults to 4, extra padding for row width calculations. Default is for legacy
+support. Set this to 0 to turn padding off.
+
+=item allow_overflow => $bool
+
+Defaults to 0. If this is off then an exception will be thrown if the table
+cannot be made to fit inside the max-width. If this is set to 1 then the table
+will be rendered anyway, larger than max-width, if it is not possible to stay
+within the max-width. In other words this turns max-width from a hard-limit to
+a soft recommendation.
+
=item sanitize => $bool
This will sanitize all the data in the table such that newlines, control
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Term-Table-0.012/t/Table.t
new/Term-Table-0.013/t/Table.t
--- old/Term-Table-0.012/t/Table.t 2017-10-11 17:54:53.000000000 +0200
+++ new/Term-Table-0.013/t/Table.t 2018-12-04 20:38:37.000000000 +0100
@@ -261,18 +261,19 @@
is_deeply(
\@table,
[
- ( $have_gcstring
+ (
+ $have_gcstring
? ()
: ("Unicode::GCString is not installed, table may not display
all unicode characters properly")
),
- '+---------------------------------------------------+',
- '| data1 |',
- '+---------------------------------------------------+',
- '| a\t\n |',
- '| \r\b\a\N{U+A0}\N{U+1680}\N{U+2000}\N{U+2001}\N{U+ |',
- '| 2002}\N{U+2003}\N{U+2004}\N{U+2008}\N{U+2028}\N{U |',
- '| +2029}\N{U+3000}\N{U+200C}\N{U+FEFF}\N{U+B}bф |',
- '+---------------------------------------------------+',
+ '+------------------------------------------------------+',
+ '| data1 |',
+ '+------------------------------------------------------+',
+ '| a\\t\\n |',
+ '| \\r\\b\\a\\N{U+A0}\\N{U+1680}\\N{U+2000}\\N{U+2001}\\N{U+200 |',
+ '| 2}\\N{U+2003}\\N{U+2004}\\N{U+2008}\\N{U+2028}\\N{U+2029} |',
+ "| \\N{U+3000}\\N{U+200C}\\N{U+FEFF}\\N{U+B}b\x{444}
|",
+ '+------------------------------------------------------+'
],
"Sanitized data"
);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Term-Table-0.012/t/issue-9.t
new/Term-Table-0.013/t/issue-9.t
--- old/Term-Table-0.012/t/issue-9.t 1970-01-01 01:00:00.000000000 +0100
+++ new/Term-Table-0.013/t/issue-9.t 2018-12-04 20:38:37.000000000 +0100
@@ -0,0 +1,57 @@
+use Test2::Tools::Tiny;
+use warnings FATAL => 'all';
+use strict;
+
+use Term::Table;
+
+my @rows;
+my @cols = 1..1;
+
+push(@rows, \@cols) for 1..1;
+
+my $table = Term::Table->new(max_width => 4, collapse => 0, rows => \@rows);
+my @table;
+
+my $ok = eval {
+ local $SIG{ALRM} = sub { die "timeout" };
+ alarm 5;
+ @table = $table->render;
+ 1;
+};
+
+ok($@ !~ m/timeout/, "Did not timeout", $@);
+ok($@ =~ m/Table is too large \(9 including 4 padding\) to fit into max-width
\(4\)/, "Threw proper exception", $@);
+ok(!@table, "Did not render");
+
+
+
+$table = Term::Table->new(max_width => 4, collapse => 0, rows => \@rows, pad
=> 0);
+
+$ok = eval {
+ local $SIG{ALRM} = sub { die "timeout" };
+ alarm 5;
+ @table = $table->render;
+ 1;
+};
+
+ok($@ !~ m/timeout/, "Did not timeout", $@);
+ok($@ =~ m/Table is too large \(5 including 0 padding\) to fit into max-width
\(4\)/, "Threw proper exception", $@);
+ok(!@table, "Did not render");
+
+
+
+$table = Term::Table->new(max_width => 4, collapse => 0, rows => \@rows,
allow_overflow => 1);
+
+$ok = eval {
+ local $SIG{ALRM} = sub { die "timeout" };
+ alarm 5;
+ @table = $table->render;
+ 1;
+};
+
+ok($ok, "Did not die", $@);
+ok($@ !~ m/timeout/, "Did not timeout", $@);
+ok(@table, "rendered");
+ok(length($table[0]) == 5, "overflow in rendering");
+
+done_testing;