<commit_before>use strict;
use warnings FATAL => 'all';

use Apache::Test;
use Apache::TestUtil;
use Apache::TestRequest qw(GET_BODY HEAD);

plan tests => 4, have_lwp;

# need LWP to handle redirects

my $base_url = "/registry/redirect.pl";

{
    my $redirect_path = "/registry/basic.pl";
    my $url = "$base_url?$redirect_path";

    ok t_cmp(
        "ok",
        GET_BODY($url),
        "test redirect: existing target",
       );
}

{
    my $redirect_path = "/registry/does_not_exists.pl";
    my $url = "$base_url?$redirect_path";
    t_client_log_error_is_expected();
    ok t_cmp(
        404,
        HEAD($url)->code,
        "test redirect: non-existing target",
       );
}

$base_url = "/registry/redirect-cookie.pl";
{
    local $Apache::TestRequest::RedirectOK = 0;

    my $redirect_path = "/registry/basic.pl";
    my $url = "$base_url?$redirect_path";
<commit_msg>tweak test format Submitted by:	geoff Reviewed by:	stas<commit_after>use strict;
use warnings FATAL => 'all';

use Apache::Test;
use Apache::TestUtil;
use Apache::TestRequest qw(GET_BODY HEAD);

plan tests => 4, have_lwp;

# need LWP to handle redirects

my $base_url = "/registry/redirect.pl";

{
    my $redirect_path = "/registry/basic.pl";
    my $url = "$base_url?$redirect_path";

    ok t_cmp(
        "ok",
        GET_BODY($url),
        "test redirect: existing target",
       );
}

{
    my $redirect_path = "/registry/does_not_exists.pl";
    my $url = "$base_url?$redirect_path";
    t_client_log_error_is_expected();
    ok t_cmp(
        404,
        HEAD($url)->code,
        "test redirect: non-existing target",
       );
}

{
    local $Apache::TestRequest::RedirectOK = 0;

    my $base_url = "/registry/redirect-cookie.pl";
    my $redirect_path = "/registry/basic.pl";
    my $url = "$base_url?$redirect_path";

{'fraction_non_alphanumeric': 0.14843320505772403, 'fraction_numerical': 0.005497526113249038, 'mean_word_length': 3.1176470588235294, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '7364448', 'n_tokens_mistral': 656, 'n_tokens_neox': 632, 'n_words': 141}