8 use DataExtract
::FixedWidth
;
9 use Test
::More tests
=> 4;
11 my $file = File
::Spec
->catfile( 't', 'data', 'SingleCol.txt' );
12 open ( my $fh, $file ) || die "Can not open $file";
16 my $fw = DataExtract
::FixedWidth
->new({ heuristic
=> \
@lines });
18 foreach my $idx ( 0 .. @lines ) {
19 my $row = $fw->parse( $lines[$idx] );
23 when ( 0 ) { ok
( !defined $col, 'undef header row' ) }
24 when ( 1 ) { ok
( $col eq 'a', "Wanted 'a', got '$col'" ) }
25 when ( 2 ) { ok
( $col eq 'b', 'resp b' ) }
26 when ( 3 ) { ok
( $col eq 'cccccccc', "Wanted 'cccccccc', got '$col'" ) }