Ancient
view release on metacpan or search on metacpan
t/9037-leak-file-callbacks.t view on Meta::CPAN
};
subtest 'grep_lines with builtin no leak' => sub {
no_leaks_ok {
for (1..100) {
my $result = file::grep_lines($test_file, 'is_not_blank');
}
} 'grep_lines with builtin does not leak';
};
subtest 'count_lines no leak' => sub {
no_leaks_ok {
for (1..200) {
my $count = file::count_lines($test_file);
}
} 'count_lines does not leak';
};
subtest 'count_lines with predicate no leak' => sub {
no_leaks_ok {
for (1..100) {
my $count = file::count_lines($test_file, 'is_not_blank');
}
} 'count_lines with predicate does not leak';
};
subtest 'find_line no leak' => sub {
no_leaks_ok {
for (1..100) {
my $found = file::find_line($test_file, sub { /cherry/ });
}
} 'find_line does not leak';
};
subtest 'find_line no match no leak' => sub {
no_leaks_ok {
for (1..100) {
my $found = file::find_line($test_file, sub { /nonexistent/ });
}
} 'find_line no match does not leak';
};
subtest 'map_lines no leak' => sub {
no_leaks_ok {
for (1..100) {
my $result = file::map_lines($test_file, sub {
uc(shift);
});
}
} 'map_lines does not leak';
};
subtest 'register_line_callback no leak' => sub {
no_leaks_ok {
for (1..100) {
file::register_line_callback("test_cb_$_", sub { 1 });
}
} 'register_line_callback does not leak';
};
subtest 'list_line_callbacks no leak' => sub {
no_leaks_ok {
for (1..200) {
my $list = file::list_line_callbacks();
}
} 'list_line_callbacks does not leak';
};
done_testing();
( run in 0.660 second using v1.01-cache-2.11-cpan-cdf2f3d4e48 )