The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
use strict;
use warnings;

use Test::More tests => 5;

use HTML::FormFu;

my $form = HTML::FormFu->new;

$form->auto_fieldset( { nested_name => 'foo' } );

$form->element('Text')->name('bar')->constraint('CallbackOnce')->callback(
    sub {
        ok(1);
        return 1;
    } );

$form->element('Text')->name('baz')->constraint('CallbackOnce')->callback(
    sub {
        ok(1);
        return 1;
    } );

$form->process( {
        'foo.bar' => 'x',
        'foo.baz' => [ 1, 2 ],
    } );

ok( !$form->has_errors('foo.bar') );
ok( !$form->has_errors('foo.baz') );

ok( !$form->has_errors );