<commit_before>#!/usr/bin/env perl

use strict;
use warnings;
use YAML qw(LoadFile);
use Test::More;
use Test::Deep;
use Data::Dumper;
use File::Basename;
use Time::HiRes qw(gettimeofday);

use lib qw(lib t/lib);

my $client
    = $ENV{ES_ASYNC}
    ? 'es_async.pl'
    : 'es_sync.pl';

my $es        = do $client or die $!;
my $wrapper   = request_wrapper();
my $skip_list = load_skip_list();

our %Supported = (
    regex         => 1,
    gtelte        => 1,
    stash_in_path => 1,
    benchmark     => sub {
        no warnings;
        grep { $_->{settings}{node}{bench} eq 'true' }
            values %{ $es->nodes->info( metric => 'settings' )->{nodes} };
    },
);

our %Test_Types = (
    is_true => sub {
        my ( $got, undef, $name ) = @_;
        ok( $got, $name );
    },
    is_false => sub {
        my ( $got, undef, $name ) = @_;
        no warnings 'uninitialized';
        ok( !$got, $name );
    },
    lt => sub {
        my ( $got, $expect, $name ) = @_;
        no warnings 'uninitialized';
        ok( $got < $expect, $name )
            or diag "Expected '< $expect', got '$got'";
    },
    gt => sub {
        my ( $got, $expect, $name ) = @_;<commit_msg>Added feature groovy_scripting to yaml tester<commit_after>#!/usr/bin/env perl

use strict;
use warnings;
use YAML qw(LoadFile);
use Test::More;
use Test::Deep;
use Data::Dumper;
use File::Basename;
use Time::HiRes qw(gettimeofday);

use lib qw(lib t/lib);

my $client
    = $ENV{ES_ASYNC}
    ? 'es_async.pl'
    : 'es_sync.pl';

my $es        = do $client or die $!;
my $wrapper   = request_wrapper();
my $skip_list = load_skip_list();

our %Supported = (
    regex         => 1,
    gtelte        => 1,
    stash_in_path => 1,
    benchmark     => sub {
        no warnings;
        grep { $_->{settings}{node}{bench} eq 'true' }
            values %{ $es->nodes->info( metric => 'settings' )->{nodes} };
    },
    groovy_scripting => sub {
        my $scripting;
        eval {
            $es->index(
                index   => 'test_script',
                type    => 't',
                id      => 1,
                refresh => 1
            );
            $scripting = eval {
                $es->search(
                    body => {
                        script_fields =>
                            { script => { lang => 'groovy', script => 1 } }
                    }
                );
                1;
            };
            $es->indices->delete( index => 'test_script' );
        };
        return $scripting;
    }
);

our %Test_Types = (
    is_true => sub {
        my ( $got, undef, $name ) = @_;
        ok( $got, $name );
    },
    is_false => sub {
        my ( $got, undef, $name ) = @_;
        no warnings 'uninitialized';
        ok( !$got, $name );
    },
    lt => sub {
        my ( $got, $expect, $name ) = @_;
        no warnings 'uninitialized';
        ok( $got < $expect, $name )
            or diag "Expected '< $expect', got '$got'";
    },
    gt => sub {
        my ( $got, $expect, $name ) = @_;
{'fraction_non_alphanumeric': 0.164523574019123, 'fraction_numerical': 0.003297065611605671, 'mean_word_length': 1.659070990359334, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 44, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7419479', 'n_tokens_mistral': 1055, 'n_tokens_neox': 1019, 'n_words': 255}