1#!perl
2
3use strict ("subs", "vars", "refs");
4use warnings ("all");
5BEGIN { $ENV{LIST_MOREUTILS_PP} = 0; }
6END { delete $ENV{LIST_MOREUTILS_PP} } # for VMS
7use List::MoreUtils (":all");
8use lib ("t/lib");
9
10
11use Test::More;
12use Test::LMU;
13
14# Normal cases
15my @list = (1 .. 10000);
16is_true(all { defined } @list);
17is_true(all { $_ > 0 } @list);
18is_false(all { $_ < 5000 } @list);
19is_true(all {});
20
21leak_free_ok(
22    all => sub {
23        my $ok  = all { $_ == 5000 } @list;
24        my $ok2 = all { $_ == 5000 } 1 .. 10000;
25    }
26);
27is_dying('all without sub' => sub { &all(42, 4711); });
28
29done_testing;
30
31
32