This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
test stash_name in less.pm
[perl5.git] / lib / less.t
CommitLineData
f8ec8cd2 1#!./perl -w
70a6dec2 2
3BEGIN {
4 chdir 't' if -d 't';
5 push @INC, '../lib';
6}
7
73afaec9 8use Test::More tests => 12;
70a6dec2 9
73afaec9
RS
10BEGIN {
11 use_ok( 'less' );
12
13 package less::again;
14 sub stash_name {'less'}
15 @ISA = 'less';
16 $INC{'less/again.pm'} = 1;
17}
6d39ae0a
JJ
18
19is_deeply([less->of], [], 'more please');
20use less;
21is_deeply([less->of], ['please'],'less please');
73afaec9 22is_deeply([less::again->of], ['please'], 'less::again please');
6d39ae0a
JJ
23no less;
24is_deeply([less->of],[],'more please');
73afaec9
RS
25is_deeply([less::again->of], [], 'no less::again please');
26use less::again;
27is_deeply([less->of], ['please'],'less please');
28is_deeply([less::again->of], ['please'], 'less::again please');
29no less::again;
30is_deeply([less->of],[],'more please');
31is_deeply([less::again->of], [], 'no less::again please');
6d39ae0a
JJ
32
33use less 'random acts';
34is_deeply([sort less->of],[sort qw(random acts)],'less random acts');
35
36is(scalar less->of('random'),1,'less random');