8 use Test::More 'no_plan';
10 sub with::Mock::right { pass $_[1] }
11 sub with::Mock::wrong { fail $_[1] }
12 sub with::Mock::test { is_deeply $_[1], $_[2], $_[3] }
14 use with \bless {}, 'with::Mock';
21 while ($c < 5) { ++$c; }
25 test !defined($c), 1, 'undef, defined';
33 test \@a, [ 2, 1 ], 'pop/shift/push/unshift';
36 test \@a, [ 1, 2 ], 'reverse';
38 open my $fh, '<', $0 or die "$!";
39 my $d = do { local $/; <$fh> };
40 $d =~ s/^(\S+).*/$1/s;
41 test $d, '#!perl', 'open/do/local';
43 @a = map { $_ + 1 } 0 .. 5;
44 test \@a, [ 1 .. 6 ], 'map';
46 @a = grep { $_ > 2 } 0 .. 5;
47 test \@a, [ 3 .. 5 ], 'grep';
49 my %h = (foo => 1, bar => 2);
50 @a = sort { $h{$a} <=> $h{$b} } keys %h;
51 test \@a, [ 'foo', 'bar' ], 'sort/keys';
53 print STDERR "# boo" if 0;