1use strict; 2use warnings; 3 4use Test::More tests => 3; 5 6use HTML::FormFu; 7 8my $form = HTML::FormFu->new; 9 10$form->auto_fieldset( { nested_name => 'foo' } ); 11 12$form->element('Text')->name('bar')->constraint('Equal')->others('foo.baz'); 13 14$form->element('Text')->name('baz'); 15 16{ 17 $form->process( 18 { 'foo.bar' => 'x', 19 'foo.baz' => 'x', 20 } ); 21 22 ok( !$form->has_errors('foo.bar') ); 23 ok( !$form->has_errors ); 24} 25 26{ 27 $form->process( 28 { 'foo.bar' => 'x', 29 'foo.baz' => 'y', 30 } ); 31 32 ok( !$form->has_errors('foo.bar') ); 33} 34