8383# print $f->dump;
8484# print $f->click->as_string;
8585
86- is( $f -> click -> as_string, <<'EOT' );
86+ chomp ( my $expected_advanced = <<'EOT' );
8787POST http://localhost/
8888Content-Length: 86
8989Content-Type: application/x-www-form-urlencoded
9090
9191i.x=1&i.y=1&c=on&r=b&t=&p=&tel=&date=&h=xyzzy&f=&x=&a=%0D%0Aabc%0D%0A+++&s=bar&m=a&m=b
9292EOT
93+ is( $f -> click-> as_string, $expected_advanced );
9394
9495is( @warn , 1 );
9596like( $warn [0], qr / ^Unknown input type 'xyzzy'/ );
@@ -463,22 +464,24 @@ EOT
463464ok( $f -> find_input(" randomkey" ) );
464465is( $f -> find_input(" randomkey" )-> challenge, " 1234567890" );
465466is( $f -> find_input(" randomkey" )-> keytype, " rsa" );
466- is( $f -> click -> as_string, <<EOT );
467+ chomp ( my $expected_keygen = <<EOT );
467468POST http://example.com/secure/keygen/test.cgi
468469Content-Length: 19
469470Content-Type: application/x-www-form-urlencoded
470471
471472Field1=Default+Text
472473EOT
474+ is( $f -> click-> as_string, $expected_keygen );
473475
474476$f -> value( randomkey => " foo" );
475- is( $f -> click -> as_string, <<EOT );
477+ chomp ( my $expected_keygen_foo = <<EOT );
476478POST http://example.com/secure/keygen/test.cgi
477479Content-Length: 33
478480Content-Type: application/x-www-form-urlencoded
479481
480482randomkey=foo&Field1=Default+Text
481483EOT
484+ is( $f -> click-> as_string, $expected_keygen_foo );
482485
483486$f = HTML::Form-> parse( <<EOT , " http://www.example.com" );
484487<form ACTION="http://example.com/">
@@ -602,13 +605,14 @@ $f = HTML::Form->parse( <<EOT, base => "http://localhost/" );
602605</form>
603606EOT
604607
605- is( $f -> click -> as_string, <<EOT );
608+ chomp ( my $expected_button_go = <<EOT );
606609POST http://localhost/
607610Content-Length: 9
608611Content-Type: application/x-www-form-urlencoded
609612
610613submit=go
611614EOT
615+ is( $f -> click-> as_string, $expected_button_go );
612616
613617$f = HTML::Form-> parse( <<EOT , base => " http://localhost/" );
614618<form method=post>
@@ -617,13 +621,14 @@ $f = HTML::Form->parse( <<EOT, base => "http://localhost/" );
617621</form>
618622EOT
619623
620- is( $f -> click -> as_string, <<EOT );
624+ chomp ( my $expected_button_empty = <<EOT );
621625POST http://localhost/
622626Content-Length: 7
623627Content-Type: application/x-www-form-urlencoded
624628
625629submit=
626630EOT
631+ is( $f -> click-> as_string, $expected_button_empty );
627632
628633# select with a name followed by select without a name GH#2
629634$f = HTML::Form-> parse( <<EOT , " http://localhost/" );
@@ -674,4 +679,4 @@ GET http://localhost/target.html?foo=option+in+named
674679EOT
675680}
676681
677- done_testing;
682+ done_testing;
0 commit comments