Skip Menu |

This queue is for tickets about the Text-Table CPAN distribution.

Report information
The Basics
Id: 79803
Status: resolved
Priority: 0/
Queue: Text-Table

People
Owner: Nobody in particular
Requestors: ilya.tk [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Bug in regex align
Date: Sun, 23 Sep 2012 05:20:36 +0400
To: bug-Text-Table [...] rt.cpan.org
From: Илья Ткаченко <ilya.tk [...] gmail.com>
--- /usr/local/share/perl/5.14.2/Text/Table.pm~ 2012-09-23 05:01:15.958537232 +0400 +++ /usr/local/share/perl/5.14.2/Text/Table.pm 2012-09-23 05:02:13.990824884 +0400 @@ -125,21 +125,21 @@ } elsif (ref($x) ne 'ARRAY') { $x = [ split /\n/, $x, -1]; } } _default_if_empty(\$align, 'auto'); unless ( - ref $align eq 'Regex' or + ref $align eq 'Regexp' or $align =~ /^(?:left|center|right|num\(?|point\(?|auto)/ ) { _warn( "Invalid align specification: '$align', using 'auto'"); $align = 'auto'; } _default_if_empty(\$align_title, 'left'); if ( ! _is_align($align_title) ) { _warn( "Invalid align_title specification: " .
Hi Ilya, thanks for your report. On Sat Sep 22 21:20:52 2012, ilya.tk@gmail.com wrote: Show quoted text
> --- /usr/local/share/perl/5.14.2/Text/Table.pm~ 2012-09-23 > 05:01:15.958537232 +0400 > +++ /usr/local/share/perl/5.14.2/Text/Table.pm 2012-09-23 > 05:02:13.990824884 +0400 > @@ -125,21 +125,21 @@ > } > elsif (ref($x) ne 'ARRAY') > { > $x = [ split /\n/, $x, -1]; > } > } > > _default_if_empty(\$align, 'auto'); > > unless ( > - ref $align eq 'Regex' or > + ref $align eq 'Regexp' or > $align =~ /^(?:left|center|right|num\(?|point\(?|auto)/ > ) { > _warn( "Invalid align specification: '$align', using 'auto'"); > $align = 'auto'; > } > > _default_if_empty(\$align_title, 'left'); > > if ( ! _is_align($align_title) ) { > _warn( "Invalid align_title specification: " .
It indeed seems like a bug (according to perldoc -f ref). However: 1. The patch uses absolute file system paths, and is not a patch that can be applied as is to the version control repository: https://github.com/shlomif/Text-Table 2. It lacks a regression automated test. 3. It does not document the change in the Changes. ---- For more information, see: http://www.shlomifish.org/open-source/resources/how-to-contribute-to-my-projects/ Regards, -- Shlomi Fish
Subject: Re: [rt.cpan.org #79803] Bug in regex align
Date: Sun, 23 Sep 2012 18:38:23 +0400
To: bug-Text-Table [...] rt.cpan.org
From: Илья Ткаченко <ilya.tk [...] gmail.com>
2012/9/23 Shlomi Fish via RT <bug-Text-Table@rt.cpan.org>: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=79803 > > > Hi Ilya, > > thanks for your report. > > On Sat Sep 22 21:20:52 2012, ilya.tk@gmail.com wrote:
>> --- /usr/local/share/perl/5.14.2/Text/Table.pm~ 2012-09-23 >> 05:01:15.958537232 +0400 >> +++ /usr/local/share/perl/5.14.2/Text/Table.pm 2012-09-23 >> 05:02:13.990824884 +0400 >> @@ -125,21 +125,21 @@ >> } >> elsif (ref($x) ne 'ARRAY') >> { >> $x = [ split /\n/, $x, -1]; >> } >> } >> >> _default_if_empty(\$align, 'auto'); >> >> unless ( >> - ref $align eq 'Regex' or >> + ref $align eq 'Regexp' or >> $align =~ /^(?:left|center|right|num\(?|point\(?|auto)/ >> ) { >> _warn( "Invalid align specification: '$align', using 'auto'"); >> $align = 'auto'; >> } >> >> _default_if_empty(\$align_title, 'left'); >> >> if ( ! _is_align($align_title) ) { >> _warn( "Invalid align_title specification: " .
> > It indeed seems like a bug (according to perldoc -f ref). However: > > 1. The patch uses absolute file system paths, and is not a patch that > can be applied as is to the version control repository: > > https://github.com/shlomif/Text-Table > > 2. It lacks a regression automated test. > > 3. It does not document the change in the Changes. > > ---- > > For more information, see: > > http://www.shlomifish.org/open-source/resources/how-to-contribute-to-my-projects/ > > Regards, > > -- Shlomi Fish > > >
It is really bug, regex alignment is not working http://search.cpan.org/~shlomif/Text-Table-1.125/lib/Text/Table.pm#Alignment expectations: $ perl -MText::Table -e 'print Text::Table->new({align => qr/!/})->load(["aa!"],["a!a"],["!aa"])' aa! a!a !aa reality: $ perl -MText::Table -e 'print Text::Table->new({align => qr/!/})->load(["aa!"],["a!a"],["!aa"])' aa! a!a !aa https://github.com/shlomif/Text-Table/blob/c28600f081e79ac722da2f42f111b350418bdd0a/Text-Table/lib/Text/Table.pm line 135. In patch above I just report about it, not full fix.
On Sun Sep 23 10:38:39 2012, ilya.tk@gmail.com wrote: Show quoted text
> 2012/9/23 Shlomi Fish via RT <bug-Text-Table@rt.cpan.org>:
> > <URL: https://rt.cpan.org/Ticket/Display.html?id=79803 > > > > > Hi Ilya, > > > > thanks for your report. > > > > On Sat Sep 22 21:20:52 2012, ilya.tk@gmail.com wrote:
> >> --- /usr/local/share/perl/5.14.2/Text/Table.pm~ 2012-09-23 > >> 05:01:15.958537232 +0400 > >> +++ /usr/local/share/perl/5.14.2/Text/Table.pm 2012-09-23 > >> 05:02:13.990824884 +0400 > >> @@ -125,21 +125,21 @@ > >> } > >> elsif (ref($x) ne 'ARRAY') > >> { > >> $x = [ split /\n/, $x, -1]; > >> } > >> } > >> > >> _default_if_empty(\$align, 'auto'); > >> > >> unless ( > >> - ref $align eq 'Regex' or > >> + ref $align eq 'Regexp' or > >> $align =~ /^(?:left|center|right|num\(?|point\(?|auto)/ > >> ) { > >> _warn( "Invalid align specification: '$align', using
> 'auto'");
> >> $align = 'auto'; > >> } > >> > >> _default_if_empty(\$align_title, 'left'); > >> > >> if ( ! _is_align($align_title) ) { > >> _warn( "Invalid align_title specification: " .
> > > > It indeed seems like a bug (according to perldoc -f ref). However: > > > > 1. The patch uses absolute file system paths, and is not a patch
> that
> > can be applied as is to the version control repository: > > > > https://github.com/shlomif/Text-Table > > > > 2. It lacks a regression automated test. > > > > 3. It does not document the change in the Changes. > > > > ---- > > > > For more information, see: > > > > http://www.shlomifish.org/open-source/resources/how-to-contribute-
> to-my-projects/
> > > > Regards, > > > > -- Shlomi Fish > > > > > >
> > It is really bug, regex alignment is not working > http://search.cpan.org/~shlomif/Text-Table- > 1.125/lib/Text/Table.pm#Alignment > > expectations: > $ perl -MText::Table -e 'print Text::Table->new({align => > qr/!/})->load(["aa!"],["a!a"],["!aa"])' > aa! > a!a > !aa > > reality: > $ perl -MText::Table -e 'print Text::Table->new({align => > qr/!/})->load(["aa!"],["a!a"],["!aa"])' > aa! > a!a > !aa > > https://github.com/shlomif/Text- > Table/blob/c28600f081e79ac722da2f42f111b350418bdd0a/Text- > Table/lib/Text/Table.pm > line 135. > > In patch above I just report about it, not full fix.
Hi Ilya, thanks. You have given me enough information to fix the bug. Regards, -- Shlomi Fish
This is fixed in Text-Table-1.126 which was uploaded to CPAN now. Thanks for the report.
Subject: Re: [rt.cpan.org #79803] Bug in regex align
Date: Sun, 23 Sep 2012 23:28:48 +0400
To: bug-Text-Table [...] rt.cpan.org
From: Илья Ткаченко <ilya.tk [...] gmail.com>
2012/9/23 Shlomi Fish via RT <bug-Text-Table@rt.cpan.org>: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=79803 > > > This is fixed in Text-Table-1.126 which was uploaded to CPAN now. Thanks > for the report.
Thanks you for fix.
On Sun Sep 23 15:29:01 2012, ilya.tk@gmail.com wrote: Show quoted text
> 2012/9/23 Shlomi Fish via RT <bug-Text-Table@rt.cpan.org>:
> > <URL: https://rt.cpan.org/Ticket/Display.html?id=79803 > > > > > This is fixed in Text-Table-1.126 which was uploaded to CPAN now. Thanks > > for the report.
> > Thanks you for fix.
You're welcome, but replying makes the ticket re-open, so it should be avoided. Closing again. Regards, -- Shlomi Fish