2 ## All code shameless ripped, with slight modifications
3 ## from BrowserUK's pm post http://perlmonks.org/?node_id=628059
8 use Test
::More tests
=> 5;
10 use DataExtract
::FixedWidth
;
12 my $file = File
::Spec
->catfile( 't', 'data', 'BrowserUK.txt' );
13 open ( my $fh, $file ) || die "Can not open $file";
16 my $de = DataExtract
::FixedWidth
->new({ heuristic
=> \
@lines });
18 foreach my $lineidx ( 1 .. @lines ) {
19 my $line = $lines[$lineidx];
20 my $arr = $de->parse( $line );
24 ok
( $arr->[0] cmp 'The First One Here Is Longer.', "Testing response (parse)" );
25 ok
( $arr->[5] cmp 'MVP', "Testing response (parse)" );
26 ok
( $arr->[4] cmp '93871', "Testing response (parse)" );
29 ok
( $arr->[1] cmp 'Twin 200 SH', "Testing response (parse)" );
30 ok
( $arr->[5] cmp 'VRE', "Testing response (parse)" );