<commit_before>use strict;

use Params::Validate qw(:all);

use Test;
BEGIN { plan test => 11 }

eval
{
    verify( params => [ 'foo' ],
            spec => [ SCALAR ],
	  );
};

ok( !$@ );

eval
{
    verify( params => { foo => 5,
                        bar => {} },
            spec => { foo => SCALAR,
                      bar => HASHREF },
	  );
};
ok( !$@ );

eval
{
    verify( params => [],
            spec => [ SCALAR ],
            called => 'Yo::Mama',
	  );
};
ok( $@ =~ /Yo::Mama/ );

{
    my %p;
    eval
    {
        %p =
            verify( params => [],
                    spec => { a => { default => 3 },
                              b => { default => 'x' } },
                  );
    };

    ok( exists $p{a} );
    ok( $p{a}, 3 );
    ok( exists $p{b} );
    ok( $p{b}, 'x' );
}

{
    my @p;
    eval
    {
        @p =
            verify( params => [],
                    spec => [ { default => 3 },
                              { default => 'x' } ],
                  );
    };

    ok( $p[0], 3 );
    ok( $p[1], 'x' );
}

{
    package Testing::X;
    use Params::Validate qw(:all);
    validation_options( allow_extra => 1 );

    eval
    {
        verify( params => [ a => 1, b => 2, c => 3 ],
                spec => { a => 1, b => 1 },
              );
    };
    main::ok( ! $@ );

    eval
    {
        verify( params => [ a => 1, b => 2, c => 3 ],
                spec => { a => 1, b => 1 },
                allow_extra => 0,
              );
    };
    main::ok( $@ =~ /was not listed/ );
}

<commit_msg>fix func name<commit_after>use strict;

use Params::Validate qw(:all);

use Test;
BEGIN { plan test => 11 }

eval
{
    validate_with( params => [ 'foo' ],
                   spec => [ SCALAR ],
                 );
};

ok( !$@ );

eval
{
    validate_with( params => { foo => 5,
                               bar => {} },
                   spec => { foo => SCALAR,
                             bar => HASHREF },
                 );
};
ok( !$@ );

eval
{
    validate_with( params => [],
                   spec => [ SCALAR ],
                   called => 'Yo::Mama',
                 );
};
ok( $@ =~ /Yo::Mama/ );

{
    my %p;
    eval
    {
        %p =
            validate_with( params => [],
                           spec => { a => { default => 3 },
                                     b => { default => 'x' } },
                         );
    };

    ok( exists $p{a} );
    ok( $p{a}, 3 );
    ok( exists $p{b} );
    ok( $p{b}, 'x' );
}

{
    my @p;
    eval
    {
        @p =
            validate_with( params => [],
                           spec => [ { default => 3 },
                                     { default => 'x' } ],
                         );
    };

    ok( $p[0], 3 );
    ok( $p[1], 'x' );
}

{
    package Testing::X;
    use Params::Validate qw(:all);
    validation_options( allow_extra => 1 );

    eval
    {
        validate_with( params => [ a => 1, b => 2, c => 3 ],
                       spec => { a => 1, b => 1 },
                     );
    };
    main::ok( ! $@ );

    eval
    {
        validate_with( params => [ a => 1, b => 2, c => 3 ],
                       spec => { a => 1, b => 1 },
                       allow_extra => 0,
                     );
    };
    main::ok( $@ =~ /was not listed/ );
}


{'fraction_non_alphanumeric': 0.19177253478523895, 'fraction_numerical': 0.012704174228675136, 'mean_word_length': 0.9921686746987952, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 79, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '593841', 'n_tokens_mistral': 1146, 'n_tokens_neox': 1063, 'n_words': 250}