#!perl -w
# Form-related tests for CGI.pm
# If you are adding or updated tests, please put tests for each methods in
# their own file, rather than growing this file any larger.
my $CRLF = "\015\012";
}
}
# Set up a CGI environment
"start_form()");
"submit()");
"submit(-name,-value)");
"submit({-name,-value})");
"textfield({-name})");
"textfield({-name,-value})");
-override => 1),
"textfield({-name,-value,-override})");
"checkbox()");
"checkbox()");
-checked => 1,
-override => 1),
qq(<label><input type="checkbox" name="weather" value="nice" tabindex="9" checked="checked" />forecast</label>),
"checkbox()");
qq(<label><input type="checkbox" name="weather" value="dull" tabindex="10" checked="checked" />forecast</label>),
"checkbox()");
qq(<label><input type="radio" name="game" value="chess" checked="checked" tabindex="11" />chess</label> <label><input type="radio" name="game" value="checkers" tabindex="12" />checkers</label>),
'radio_group()');
qq(<label><input type="radio" name="game" value="chess" checked="checked" tabindex="13" />ping pong</label> <label><input type="radio" name="game" value="checkers" tabindex="14" />checkers</label>),
'radio_group()');
qq(<label><input type="checkbox" name="game" value="checkers" checked="checked" tabindex="15" />checkers</label> <label><input type="checkbox" name="game" value="chess" checked="checked" tabindex="16" />chess</label> <label><input type="checkbox" name="game" value="cribbage" tabindex="17" />cribbage</label>),
'checkbox_group()');
'-defaults' => ['cribbage'],
-override=>1),
qq(<label><input type="checkbox" name="game" value="checkers" tabindex="18" />checkers</label> <label><input type="checkbox" name="game" value="chess" tabindex="19" />chess</label> <label><input type="checkbox" name="game" value="cribbage" checked="checked" tabindex="20" />cribbage</label>),
'checkbox_group()');
-override => 1),
'<select name="game" tabindex="21" >
<option value="checkers">checkers</option>
<option value="chess">chess</option>
<option selected="selected" value="cribbage">cribbage</option>
</select>',
'popup_menu()');
-override=>1),
'<select name="game" tabindex="22" size="3">
<option value="checkers">checkers</option>
<option value="chess">chess</option>
<option selected="selected" value="cribbage">cribbage</option>
</select>',
'scrolling_list()');
qq(<label><input type="checkbox" name="game" value="checkers" checked="checked" tabindex="23" disabled='1'/><span style="color:gray">checkers</span></label> <label><input type="checkbox" name="game" value="chess" checked="checked" tabindex="24" />chess</label> <label><input type="checkbox" name="game" value="cribbage" tabindex="25" />cribbage</label>),
'checkbox_group()');
</optgroup>),
'optgroup()');
'meenie'=>'two',
'minie'=>'three'},
</optgroup>
</select>),
'popup_menu() + optgroup()');
'meenie'=>'two',
'minie'=>'three'},
</optgroup>
</select>),
'scrolling_list() + optgroup()');
# ---------- START 22046 ----------
# The following tests were added for
# SHCOREY at cpan.org
# Saved whether working with XHTML because need to test both
# with it and without.
# set XHTML
},
'start_form() + XHTML');
},
'start_form() + XHTML + URL_ENCODED');
},
'start_form() + XHTML + MULTIPART');
},
'start_multipart_form() + XHTML');
},
'start_multipart_form() + XHTML + additional args');
# set no XHTML
},
'start_form() + NO_XHTML');
},
'start_form() + NO_XHTML + URL_ENCODED');
},
'start_form() + NO_XHTML + MULTIPART');
},
'start_multipart_form() + NO_XHTML');
},
'start_multipart_form() + NO_XHTML + additional args');
# restoring value