X-Git-Url: http://git.shiar.net/perl/html-form-simple.git/blobdiff_plain/d5415f8292000c0eba35458ce61500eaff9cd4d1..cb6c92feb70f4246804078114bb8ef37874ab1cd:/t/html.t diff --git a/t/html.t b/t/html.t index b7568b0..c646cdb 100644 --- a/t/html.t +++ b/t/html.t @@ -5,7 +5,7 @@ use warnings; use Test::More; -plan tests => 47; +plan tests => 50; use_ok('HTML::Form::Simple'); @@ -330,28 +330,50 @@ is( ); is( - $form->check(foo => 'test', {value => undef}), - '', - 'check parameters' + $form->check(foo => '<">'), + '', + 'labeled checkbox' ); is( - $form->check(undef, '', 1), - '', - 'simple checkbox' + $form->check(foo => {label => 'test', value => undef}, {disabled => 1}), + '', + 'check parameters' +); + +is_deeply( + [ $form->check(undef, '', 1) ], + [ '' ], + 'anonymous checkbox' ); -TODO: { - local $TODO = 'shorthand'; is_deeply( [ $form->check(undef, ['', '<">']) ], [ - '', - '', + '', + '', ], 'multiple checkboxes' ); -}; + +is_deeply( + [ $form->check(undef, [{}, undef], 1) ], + [ + '', + '', + ], + 'multiple checked checkboxes' +); + +is_deeply( + [ $form->check(undef, [{value => 4, type => 'radio'}], [1, 0, 0], {value => 3}) ], + [ + '', + '', + '', + ], + 'various checkboxes' +); #TODO