Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Adding test for rt34546

  • Loading branch information...
commit 1bed9ebc127cf681fdf36bbda953e5064d621119 1 parent 23d59fa
Trey Harris authored
Showing with 15 additions and 1 deletion.
  1. +15 −1 test.pl
View
16 test.pl
@@ -1,8 +1,11 @@
use Test;
-BEGIN { plan tests => 4 };
+BEGIN { plan tests => 5 };
use Text::FormatTable;
ok(1); # If we made it this far, we're ok.
+use strict;
+use warnings;
+
{
my $table = Text::FormatTable->new('r| l l');
$table->head('a', 'b', 'c');
@@ -58,3 +61,14 @@ END
my ($rule) = ($output =~ /(=+)/);
ok(length($rule), length("foo bar bat"));
}
+
+# rt34546, warnings when column has zero length
+{
+ my $warning;
+ local $SIG{__WARN__} = sub { $warning = $_[0] };
+
+ my $table = Text::FormatTable->new('l l');
+ $table->head('foo', q{});
+ my $output = $table->render();
+ ok(not defined $warning);
+}
Please sign in to comment.
Something went wrong with that request. Please try again.