Skip Menu |

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

Report information
The Basics
Id: 36823
Status: resolved
Worked: 1 min
Priority: 0/
Queue: Text-RecordParser

People
Owner: kclark [...] cpan.org
Requestors: rsvancara [...] gmail.com
Cc: michael [...] thegrebs.com
AdminCc:

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



Subject: Text::RecordParser fails tests on Centos 5.1
I can do a perl Makefile.PL followed by a successful make. But make test fails. And applications, in particular CMAP (A comparitive mapping application written perl) fails when trying to import tab delimited data. Here is the out put of make test: make test /usr/bin/perl Build --makefile_env_macros 1 test t/00-pipe.............ok t/01-new..............ok t/02-filename-fh......1/41 Error reading line number 1: name instrument at t/02-filename-fh.t line 166 # Looks like you planned 41 tests but only ran 27. # Looks like your test died just after 27. t/02-filename-fh...... Dubious, test returned 255 (wstat 65280, 0xff00) Failed 14/41 subtests t/03-separator........ok t/04-bind.............1/16 Error reading line number 1: Name Address City State Wife Children Pets at t/04-bind.t line 74 # Looks like you planned 16 tests but only ran 13. # Looks like your test died just after 13. t/04-bind............. Dubious, test returned 255 (wstat 65280, 0xff00) Failed 3/16 subtests t/05-fetch............1/35 Error reading line number 1: Name Address City State Wife Children Pets at t/05-fetch.t line 226 # Looks like you planned 35 tests but only ran 34. # Looks like your test died just after 34. t/05-fetch............ Dubious, test returned 255 (wstat 65280, 0xff00) Failed 1/35 subtests t/06-filter...........ok t/07-parse............Error reading line number 1: Name Address City State Wife Children Pets at t/07-parse.t line 22 # Looks like your test died before it could output anything. t/07-parse............ Dubious, test returned 255 (wstat 65280, 0xff00) Failed 4/4 subtests t/08-compute..........ok t/09-comment..........ok t/10-tablify..........ok t/11-tabmerge.........ok t/pod-coverage........ok t/pod.................ok Test Summary Report ------------------- t/02-filename-fh.t (Wstat: 65280 Tests: 27 Failed: 0) Non-zero exit status: 255 Parse errors: Bad plan. You planned 41 tests but ran 27. t/04-bind.t (Wstat: 65280 Tests: 13 Failed: 0) Non-zero exit status: 255 Parse errors: Bad plan. You planned 16 tests but ran 13. t/05-fetch.t (Wstat: 65280 Tests: 34 Failed: 0) Non-zero exit status: 255 Parse errors: Bad plan. You planned 35 tests but ran 34. t/07-parse.t (Wstat: 65280 Tests: 0 Failed: 0) Non-zero exit status: 255 Parse errors: Bad plan. You planned 4 tests but ran 0. Files=14, Tests=171, 2 wallclock secs ( 0.13 usr 0.04 sys + 1.04 cusr 0.29 csys = 1.50 CPU) Result: FAIL Failed 4/14 test programs. 0/171 subtests failed. make: *** [test] Error 255 The following perl script fails: #!/usr/bin/perl -w use strict; use warnings; use Data::Dumper; my $list_1a = [ 1, -1, 1.2, '1.3s', '123\12', -2.12 ]; my $list_2a = [ [ 5, 6 ], [ 7, 8 ] ]; my $str1 = '0100'; my $str2 = 'blah.ab1.s/cmap.conf\\'; my $hash_1 = { 1 => 2, 3 => 4, }; my $hash_2 = { 5 => 6, 7 => 8, 3 => 4, }; my %hash = ( 1 => 2, 3 => 4, ); use Text::RecordParser; use Text::ParseWords 'parse_line'; my $file_in = $ARGV[0] or die; my $fh; open $fh, $file_in; my $parser = Text::RecordParser->new( fh => $fh, field_separator => "\t", header_filter => sub { $_ = shift; s/\s+/_/g; lc $_ }, field_filter => sub { $_ = shift; s/^\s+|\s+$//g; $_ }, ); $parser->field_compute( 'feature_aliases', sub { [ parse_line( ',', 0, shift() ) ] } ); $parser->bind_header; print STDERR Dumper($parser->field_list )."\n"; Here is a sample dataset that I used: map_name map_display_order feature_name feature_aliases feature_type feature_start EF1 1 CPPCT016 CPPCT16 SSR 0.000 EF1 1 PceGA65 SSR 0.682 EF1 1 EMPA005 SSR 31.311 EF1 1 EPDCU5100 SSR 33.434 EF1 1 UCD-CH31 SSR 36.830 EF1 1 EAA/MCCC-350 AFLP 39.221 EF1 1 EAT/MCCC-235 AFLP 40.990 EF1 1 EAT/MCTC-232 AFLP 42.664 EF1 1 EPPCU2407 EST-SSR 46.398 EF1 1 EAC/MCTA-535 AFLP 48.798 EF1 1 PceGA59 SSR 52.895 EF1 1 EPPCU1589 EST-SSR 75.246 Error reading line number 1: map_name map_display_order feature_name feature_aliases feature_type feature_start at ./play.pl line 27 I marked this as critical, mainly because the tests fail and applications that use it seem to fail on my platform. Platform information: Perl Version 5.8.8 built for x86_64-linux-thread-multi Linux Kernel: Linux dev2.local 2.6.18-53.1.14.el5 #1 SMP Wed Mar 5 11:37:38 EST 2008 x86_64 x86_64 x86_64 GNU/Linux Distro: Centos 5.1
If you could provide a full file showing what fails, that would be helpful. I imagine this is due to a single quote in the input (which would be handled by the upcoming 1.3.0 version fine). BTW, I wrote CMap, too.
I'm hoping this is fixed in later releases. Was it the single quote?