File: after_incl.pm

package info (click to toggle)
liblist-moreutils-perl 0.430-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 1,228 kB
  • sloc: perl: 13,167; makefile: 17
file content (21 lines) | stat: -rw-r--r-- 493 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21

use Test::More;
use Test::LMU;

my @x = after_incl { $_ % 5 == 0 } 1 .. 9;
is_deeply(\@x, [5, 6, 7, 8, 9], "after 5, included");

@x = after_incl { /foo/ } qw{bar baz};
is_deeply(\@x, [], 'Got the null list');

@x = after_incl { /b/ } qw{bar baz foo};
is_deeply(\@x, [qw{bar baz foo}], "after /b/, included");

leak_free_ok(
    after_incl => sub {
        @x = after_incl { /z/ } qw{bar baz foo};
    }
);
is_dying('after_incl without sub' => sub { &after_incl(42, 4711); });

done_testing;