Data-FormValidator

 view release on metacpan or  search on metacpan

t/FV_length.t  view on Meta::CPAN

# check expected values for valid untainted fields
for my $field (qw( alpha charlie echo ))
{
  is( $multiline_result->valid($field), $expect->{$field}, "identity $field" );
}

# Test "long" results. Early implementations checked length with
# regular expressions which limit length options to 32kb.
# The 80000 char test string is an arbitrary length.
# good a value as any other. And it's pretty long.
# Just for good measure we'll use the unicode smiley character (as seen in
# perluniintro) in our test string.

my $smiley      = "\x{263a}";            # Thats "smiling face, white" folks!
my $long_string = "x$smiley" x 40000;    # results in a 80000 length string
my $long_result = Data::FormValidator->check( {
    alpha   => $long_string,
    beta    => $long_string,
    charlie => $long_string,
    delta   => $long_string,
    echo    => $long_string,



( run in 0.810 second using v1.01-cache-2.11-cpan-88abd93f124 )