Skip to content

Commit 509d623

Browse files
Sadraksimbabque
authored andcommitted
- Tests for submit buttons with and without value
- see gisle/html-form#7
1 parent ae7b5ee commit 509d623

1 file changed

Lines changed: 31 additions & 1 deletion

File tree

t/form.t

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
use strict;
44
use Test qw(plan ok);
55

6-
plan tests => 127;
6+
plan tests => 129;
77

88
use HTML::Form;
99

@@ -595,3 +595,33 @@ $f = HTML::Form->parse(<<EOT, "http://www.example.com");
595595
</form>
596596
EOT
597597
ok(@warn, 0);
598+
599+
$f = HTML::Form->parse(<<EOT, base => "http://localhost/");
600+
<form method=post>
601+
<form action="test" method="post">
602+
<button type="submit" name="submit" value="go">run</button>
603+
</form>
604+
EOT
605+
606+
ok($f->click->as_string, <<EOT);
607+
POST http://localhost/
608+
Content-Length: 9
609+
Content-Type: application/x-www-form-urlencoded
610+
611+
submit=go
612+
EOT
613+
614+
$f = HTML::Form->parse(<<EOT, base => "http://localhost/");
615+
<form method=post>
616+
<form action="test" method="post">
617+
<button type="submit" name="submit">run</button>
618+
</form>
619+
EOT
620+
621+
ok($f->click->as_string, <<EOT);
622+
POST http://localhost/
623+
Content-Length: 7
624+
Content-Type: application/x-www-form-urlencoded
625+
626+
submit=
627+
EOT

0 commit comments

Comments
 (0)