<commit_before>use v6;

use lib 't/lib';
use Test::TCP;

use Test;

use HTTP::Server::Tiny;
use HTTP::Tinyish;

plan 5;

my $port = 15555;

my $server = HTTP::Server::Tiny.new(host => '127.0.0.1', port => $port);

my $thr = Thread.start({
    $server.run(sub ($env) {
        isa-ok $env<p6w.version>, Version;
        is $env<p6w.multithread>, False;
        is $env<p6w.multiprocess>, False;
        is $env<p6w.run-once>, False;
        return 200, ['Content-Type' => 'text/plain'], ["hello\n".encode('utf-8')]
    });
}, :app_lifetime);

wait_port($port);

my $sock = IO::Socket::INET.new(
    host => '127.0.0.1',
    port => $port,
);
$sock.print("GET / HTTP/1.0\r\n\r\n");
my Str $buf;
while my $got = $sock.recv() {
    $buf ~= $got;
}<commit_msg>Oops. I should change test case too. https://github.com/tokuhirom/p6-HTTP-Server-Tiny/pull/60/commits/518cb6a92a9fb3addb41fa00edc055f1e5c0e283<commit_after>use v6;

use lib 't/lib';
use Test::TCP;

use Test;

use HTTP::Server::Tiny;
use HTTP::Tinyish;

plan 5;

my $port = 15555;

my $server = HTTP::Server::Tiny.new(host => '127.0.0.1', port => $port);

my $thr = Thread.start({
    $server.run(sub ($env) {
        isa-ok $env<p6w.version>, Version;
        is $env<p6w.multithread>, True;
        is $env<p6w.multiprocess>, False;
        is $env<p6w.run-once>, False;
        return 200, ['Content-Type' => 'text/plain'], ["hello\n".encode('utf-8')]
    });
}, :app_lifetime);

wait_port($port);

my $sock = IO::Socket::INET.new(
    host => '127.0.0.1',
    port => $port,
);
$sock.print("GET / HTTP/1.0\r\n\r\n");
my Str $buf;
while my $got = $sock.recv() {
    $buf ~= $got;
}
{'fraction_non_alphanumeric': 0.21550671550671552, 'fraction_numerical': 0.050061050061050064, 'mean_word_length': 3.2242268041237114, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 21, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, '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': '6380247', 'n_tokens_mistral': 731, 'n_tokens_neox': 695, 'n_words': 139}