11 delete @ENV{ qw( IFS CDPATH ENV BASH_ENV PATH ) };
14 plan skip_all => 'Not installing mech-dump' if -e File::Spec->catfile( qw( t SKIP-MECH-DUMP ) );
17 my $exe = File::Spec->catfile( qw( blib script mech-dump ) );
19 $exe = qq[mcr $^X "-mblib" $exe];
22 # Simply use a file: uri instead of the filename to make this test
23 # more independent of what URI::* thinks.
24 my $source = 'file:t/google.html';
27 $perl = $1 if $^X =~ /^(.+)$/;
28 my $command = "$perl -Mblib $exe --forms $source";
30 my $actual = `$command`;
33 if ( $LWP::VERSION < 5.800 ) {
35 GET file:/target-page [bob-the-form]
37 ie=ISO-8859-1 (hidden)
39 btnG=Google Search (submit)
40 btnI=I'm Feeling Lucky (submit)
44 GET file:/target-page [bob-the-form]
45 hl=en (hidden readonly)
46 ie=ISO-8859-1 (hidden readonly)
48 btnG=Google Search (submit)
49 btnI=I'm Feeling Lucky (submit)
53 my @actual = split /\s*\n/, $actual;
54 my @expected = split /\s*\n/, $expected;
56 # First line is platform-dependent, so handle it accordingly.
58 my $first = shift @actual;
59 like( $first, qr/^GET file:.*\/target-page \[bob-the-form\]/, 'First line matches' );
61 cmp_ok( @expected, '>', 0, 'Still some expected' );
62 cmp_ok( @actual, '>', 0, 'Still some actual' );
64 is_deeply( \@actual, \@expected, 'Rest of the lines match' );