X-Git-Url: http://git.shiar.net/perl/html-form-simple.git/blobdiff_plain/b01a7f21ade2de12b620970a9e7ae78cbabd95da..d5415f8292000c0eba35458ce61500eaff9cd4d1:/t/html.t diff --git a/t/html.t b/t/html.t index 60e9507..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'); @@ -276,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'), '',