X-Git-Url: http://git.shiar.net/gitweb.cgi/perl/html-form-simple.git/blobdiff_plain/be81b5d559a8ed87ee6493f27b698343fada60c4..d5415f8292000c0eba35458ce61500eaff9cd4d1:/t/html.t?ds=sidebyside
diff --git a/t/html.t b/t/html.t
index d12d6ef..b7568b0 100644
--- a/t/html.t
+++ b/t/html.t
@@ -5,7 +5,7 @@ use warnings;
use Test::More;
-plan tests => 43;
+plan tests => 47;
use_ok('HTML::Form::Simple');
@@ -119,15 +119,22 @@ is(
);
is(
- $form->input('', '', {disabled => 0, something => undef, class => undef, style => ''}),
+ $form->input('', '', {
+ disabled => 0,
+ something => undef,
+ class => undef,
+ style => '',
+ name => 'ignore',
+ value => 'overrides',
+ }),
'',
'input with empty attributes'
);
is(
- $form->input(undef, undef, {name => 'override', value => 'override'}),
- '',
- 'ignore input overrides'
+ $form->input(undef, undef, {name => '0', value => '0'}),
+ '',
+ 'input overrides'
);
is(
@@ -269,17 +276,53 @@ is_deeply(
);
is(
- $form->radio(foo => 1),
- '',
+ $form->radio(foo => 'test'),
+ '',
'radio method'
);
+is(
+ $form->radio(foo => undef, [2]), #TODO
+ '',
+ 'labelless radio'
+);
+
is(
$form->radio(undef, {checked => 1}),
'',
'simple radio button'
);
+is_deeply(
+ [ $form->radio(undef, ['', '<">']) ],
+ [
+ '',
+ '',
+ ],
+ 'multiple radios'
+);
+
+is_deeply(
+ [ $form->radio(foo => 'test', ['foo', ''], {value => '', id => ''}) ],
+ [
+ '',
+ '',
+ ],
+ 'multiple radios with custom value'
+);
+
+is_deeply(
+ [ $form->radio(foo => ['', 0], [0, 1, '']) ],
+ [
+ '',
+ '',
+ '',
+ ],
+ 'multiple radios with custom values'
+);
+
+# check
+
is(
$form->check('foo'),
'',