File tree 2 files changed +48
-0
lines changed
2 files changed +48
-0
lines changed Original file line number Diff line number Diff line change @@ -93,6 +93,7 @@ t/html/form.t Test HTML::Form module
93
93
t/html/form-param.t More HTML::Form tests.
94
94
t/html/form-multi-select.t More HTML::Form tests
95
95
t/html/form-maxlength.t More HTML::Form tests
96
+ t/html/form-selector.t More HTML::Form tests
96
97
t/live/apache.t
97
98
t/live/apache-listing.t Test File::Listing::apache package
98
99
t/live/https.t
Original file line number Diff line number Diff line change
1
+ # !perl -w
2
+
3
+ use strict;
4
+ use Test qw( plan ok) ;
5
+
6
+ plan tests => 12;
7
+
8
+ use HTML::Form;
9
+
10
+ my $form = HTML::Form-> parse(<<"EOT" , base => " http://example.com" , strict => 1);
11
+ <form>
12
+ <input name="n1" id="id1" class="A" value="1">
13
+ <input id="id2" class="A" value="2">
14
+ <input id="id3" class="B" value="3">
15
+ <select id="id4">
16
+ <option>1
17
+ <option>2
18
+ <option>3
19
+ </selector>
20
+ <input id="#foo" name="#bar" class=".D" disabled>
21
+ </form>
22
+ EOT
23
+
24
+ # $form->dump;
25
+
26
+ ok($form -> value(" n1" ), 1);
27
+ ok($form -> value(" ^n1" ), 1);
28
+ ok($form -> value(" #id1" ), 1);
29
+ ok($form -> value(" .A" ), 1);
30
+ ok($form -> value(" #id2" ), 2);
31
+ ok($form -> value(" .B" ), 3);
32
+
33
+ ok(j(map $_ -> value, $form -> find_input(" .A" )), " 1:2" );
34
+
35
+ $form -> find_input(" #id2" )-> name(" n2" );
36
+ $form -> value(" #id2" , 22);
37
+ ok($form -> click-> uri-> query, " n1=1&n2=22" );
38
+
39
+ # try some odd names
40
+ ok($form -> find_input(" ##foo" )-> name, " #bar" );
41
+ ok($form -> find_input(" #bar" ), undef );
42
+ ok($form -> find_input(" ^#bar" )-> class, " .D" );
43
+ ok($form -> find_input(" ..D" )-> id, " #foo" );
44
+
45
+ sub j {
46
+ join (" :" , @_ );
47
+ }
You can’t perform that action at this time.
0 commit comments