<commit_before># Pragmas.
use strict;
use warnings;

# Modules.
use English qw(-no_match_vars);
use Error::Pure::Utils qw(err_get);
use File::Object;
use Test::More 'tests' => 2;

# Path to dir with T.pm. And load T.pm.
my $current_dir;
BEGIN {
	$current_dir = File::Object->new;
	unshift @INC, $current_dir->s;
};
use T;

# Test.
eval {
	T::error2;
};
is($EVAL_ERROR, "Second error in T2 class.\n");

# Test.
my $errors = err_get();
my $right_ret = [{
	'msg' => ['Error in T2 class.'],
	'stack' => [{
		'args' => '(\'Error in T2 class.\')',
		'class' => 'T',
		'line' => 15,
		'prog' => $current_dir->file('T.pm')->s,
		'sub' => 'err',
	}, {
		'args' => '()',
		'class' => 'T',
		'line' => 21,
		'prog' => $current_dir->file('T.pm')->s,
		'sub' => 'error',
	}, {
		'args' => '',
		'class' => 'T',
		'line' => 20,
		'prog' => $current_dir->file('T.pm')->s,
		'sub' => 'eval {...}',
	}],
}, {
	'msg' => ['Second error in T2 class.'],
	'stack' => [{
		'args' => '(\'Second error in T2 class.\')',
		'class' => 'T',
		'line' => 27,
		'prog' => $current_dir->file('T.pm')->s,
		'sub' => 'err',
	}, {
		'args' => '()',
		'class' => 'main',
		'line' => 22,
		'prog' => $current_dir->file('04-clean.t')->s,
		'sub' => 'T::error2',
	}, {
		'args' => '',
		'class' => 'main',
		'line' => 21,
		'prog' => $current_dir->file('04-clean.t')->s,
		'sub' => 'eval {...}',
	}],
}];
is_deeply($errors, $right_ret);<commit_msg>Rewrite $errors to better @errors.<commit_after># Pragmas.
use strict;
use warnings;

# Modules.
use English qw(-no_match_vars);
use Error::Pure::Utils qw(err_get);
use File::Object;
use Test::More 'tests' => 2;

# Path to dir with T.pm. And load T.pm.
my $current_dir;
BEGIN {
	$current_dir = File::Object->new;
	unshift @INC, $current_dir->s;
};
use T;

# Test.
eval {
	T::error2;
};
is($EVAL_ERROR, "Second error in T2 class.\n");

# Test.
my @errors = err_get();
my $right_ret = [{
	'msg' => ['Error in T2 class.'],
	'stack' => [{
		'args' => '(\'Error in T2 class.\')',
		'class' => 'T',
		'line' => 15,
		'prog' => $current_dir->file('T.pm')->s,
		'sub' => 'err',
	}, {
		'args' => '()',
		'class' => 'T',
		'line' => 21,
		'prog' => $current_dir->file('T.pm')->s,
		'sub' => 'error',
	}, {
		'args' => '',
		'class' => 'T',
		'line' => 20,
		'prog' => $current_dir->file('T.pm')->s,
		'sub' => 'eval {...}',
	}],
}, {
	'msg' => ['Second error in T2 class.'],
	'stack' => [{
		'args' => '(\'Second error in T2 class.\')',
		'class' => 'T',
		'line' => 27,
		'prog' => $current_dir->file('T.pm')->s,
		'sub' => 'err',
	}, {
		'args' => '()',
		'class' => 'main',
		'line' => 22,
		'prog' => $current_dir->file('04-clean.t')->s,
		'sub' => 'T::error2',
	}, {
		'args' => '',
		'class' => 'main',
		'line' => 21,
		'prog' => $current_dir->file('04-clean.t')->s,
		'sub' => 'eval {...}',
	}],
}];
is_deeply(\@errors, $right_ret);
{'fraction_non_alphanumeric': 0.29859154929577464, 'fraction_numerical': 0.016901408450704224, 'mean_word_length': 3.3775038520801233, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 101, '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': '1056253', 'n_tokens_mistral': 1360, 'n_tokens_neox': 1259, 'n_words': 263}