join multiple select results by $OFS
[perl/html-form-simple.git] / t / html.t
index e5abb9ac5ac34e2e4550dc4c52e4d590043ff1b6..8ab4806da4e9910cde6fd2c9deefc3b30cf2bf60 100644 (file)
--- a/t/html.t
+++ b/t/html.t
@@ -5,7 +5,7 @@ use warnings;
 
 use Test::More;
 
-plan tests => 51;
+plan tests => 52;
 
 use_ok('HTML::Form::Simple');
 
@@ -286,7 +286,7 @@ is(
 );
 
 is(
-       $form->radio(foo => undef, [2]), #TODO
+       $form->radio(foo => undef, 2),
        '<input id="foo_2" name="foo" type="radio" value="2">',
        'labelless radio'
 );
@@ -369,6 +369,18 @@ is_deeply(
        'multiple checked checkboxes'
 );
 
+{
+       local $, = ' | ';
+       is(
+               scalar $form->check(foo => [1, 0], {value => 0}),
+               join(' | ',
+                       '<label><input id="foo_1" name="foo" type="checkbox" value="1"> 1</label>',
+                       '<label><input id="foo_2" name="foo" type="checkbox" value="2"> 0</label>',
+               ),
+               'merged checkboxes'
+       );
+}
+
 is_deeply(
        [ $form->check(undef, [{value => 4, type => 'radio'}], [1, 0, 0], {value => 3}) ],
        [