File: none_u.pm

package info (click to toggle)
liblist-moreutils-xs-perl 0.430-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,116 kB
  • sloc: perl: 9,038; ansic: 159; makefile: 3
file content (20 lines) | stat: -rw-r--r-- 427 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

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

# Normal cases
my @list = (1 .. 10000);
is_true(none_u { not defined } @list);
is_true(none_u { $_ > 10000 } @list);
is_false(none_u { defined } @list);
is_undef(none_u {});

leak_free_ok(
    none_u => sub {
        my $ok  = none_u { $_ == 5000 } @list;
        my $ok2 = none_u { $_ == 5000 } 1 .. 10000;
    }
);
is_dying('none_u without sub' => sub { &none_u(42, 4711); });

done_testing;