<commit_before>use v6;
use Test;

BEGIN { @*INC.unshift('lib') }

use GD::Raw;
plan 7;

# Create image
{
        my $img = gdImageCreateTrueColor(64, 64);
        ok $img, "Created an image";
        gdImageDestroy($img);
}

my $tmp-path = IO::Path.new(IO::Spec.tmpdir).child("gd-raw-tmpimg");

# Create and load a png
{
        my $img = gdImageCreateTrueColor(64, 64);
        my $fh = fopen($tmp-path.Str, "wb");
        ok $fh, "Open image for writing";
        lives_ok { gdImagePng($img, $fh) }, "Wrote png";
        fclose($fh);
        gdImageDestroy($img);


        $fh = fopen($tmp-path.Str, "rb");<commit_msg>Fix deprecated usage in tests<commit_after>use v6;
use Test;

BEGIN { @*INC.unshift('lib') }

use GD::Raw;
plan 7;

# Create image
{
        my $img = gdImageCreateTrueColor(64, 64);
        ok $img, "Created an image";
        gdImageDestroy($img);
}

my $tmp-path = $*TMPDIR.child("gd-raw-tmpimg");

# Create and load a png
{
        my $img = gdImageCreateTrueColor(64, 64);
        my $fh = fopen($tmp-path.Str, "wb");
        ok $fh, "Open image for writing";
        lives-ok { gdImagePng($img, $fh) }, "Wrote png";
        fclose($fh);
        gdImageDestroy($img);


        $fh = fopen($tmp-path.Str, "rb");
{'fraction_non_alphanumeric': 0.17219078415521422, 'fraction_numerical': 0.016168148746968473, 'mean_word_length': 2.7065868263473054, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3588873', 'n_tokens_mistral': 494, 'n_tokens_neox': 455, 'n_words': 111}